Giter Site home page Giter Site logo

oauth's People

Contributors

denizzzka avatar geod24 avatar lionello avatar martinnowak avatar thaven avatar vporton avatar wilzbach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

oauth's Issues

More changes from teamhackback

Hi there,

I saw your nice OAuth module and as you have seen I liked it so much that I have forked it at https://github.com/teamhackback/oauth

I have done a couple of further changes and due to the split of client.d into multiple files a PR might be long. However if you are interested I am happy to look into cleaning the changes and incorporating them into a PR. I also plan to publish a bigger example app in the next weeks.

Here's an overview of major changes:

Bug fixes

Other changes

  • Split client.d into exception.d, session.d, settings.d (config.d is part of settings.d)
  • Made a lot of stuff @safe for Vibe.d 0.8
  • Add GitHub provider
  • Load config from environment
  • Added minimal logging
  • Added extraParams to webapp.login
  • Changed return type of webapp.login to bool

Removed caching from Webapp convience wrapper

As I want to deploy my application on multiple servers/threads a cache is problematic as the second request might hit another thread / server. Moreover a long-running application also needs some auto-cleanup, which currently isn't implemented. Thus I removed both settingsCache and sessionCache.

loadFromEnvironment

I use something like this instead of loadConfig in settings.d.
This isn't something complex, hence I opened this issue to see whether this would be interesting for others.

auto loadFromEnvironment(
    string providerName,
    string envPrefix,
    string redirectUri,
)
{
    import std.process : environment;
    string clientId = environment[envPrefix ~ "_CLIENTID"];
    string clientSecret = environment[envPrefix ~ "_CLIENTSECRET"];

    return new immutable(OAuthSettings)(
        providerName,
        clientId,
        clientSecret,
        redirectUri);
}

Deprecation message, Ubuntu 14.04 x86

I got this message:

oauth 0.1.1: building configuration "library"...
../../../../.dub/packages/oauth-0.1.1/oauth/source/oauth/client.d(565,9): Deprecation: catch statement without an exception specification is deprecated; use catch(Throwable) for old behavior
../../../../.dub/packages/oauth-0.1.1/oauth/source/oauth/webapp.d(159,9): Deprecation: catch statement without an exception specification is deprecated; use catch(Throwable) for old behavior

Memory corruption issue (0.1.4)

@thaven @wilzbach
Seems like this is yet another victim of issue https://issues.dlang.org/show_bug.cgi?id=12625 .

In 0.1.4 there's this line in client.d:

this.hash = sha256Of(provider.tokenUri ~ ' ' ~ clientId);

This assigns stack allocated memory to this.hash and the value i later overwritten by other stack data. Looks like this code was refactored so maybe master is not affected. Nevertheless a bugfix release would be nice. Solution: Use .idup.

I also suggest to be careful with the loginKey/LoginData.key methods. AFAICS the code won't cause corruption, but as you return a static array from this function you have to make sure all uses of this function are safe (essentially you have to threat the returned array as scope).

Example code

Hey, I need OAuth for one of my projects and it looks like this project would really fit me.

I see that the master branch differs a lot from the v0.0.1-alpha tag, so I'm wonder which I should use.

I would guess that the master branch isn't really done yet, because it userAuthUri and userSession are private. (Bug?)
Is there anything I could help with?

  • Dan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.