-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Odd location for UnMarshal #19
Comments
Open a PR with the changes you're suggesting if it makes sense I'll merge it in. |
Moved UnmarshalSession method in Session. |
I think the intent of the issue was not that we need to cut and paste the As mentioned, the |
Sorry, It was a mistake. I rollbacked it. |
Closing this due to age, feel free to re-open if it's still an issue. |
As pointed out in markbates#19, there are cases where the scopes returned from the /scopes call don't include the scope(s) we need. This is because there are catch-all scopes that give access to the necessary APIs even without the explicit scope we've asked for.
First, great work, just came across this in the golang weekly newsletter and I've felt your pain re. authenticating with other services.
Obviously down to individual developer's opinions but it feels like Provider.UnmarshalSession should really be an initialization function for Session objects in the provider's session.go, not least of all because its symmetrical partner, Session.Marshal is on the Session. UnmarshalSession makes no use of the Provider instance it is passed so at the very least (and it's a non-breaking change), it shouldn't be a Provider pointer but a Provider object in the signature, to make it clear the function doesn't modify the Provider instance it is called on.
I'm guessing you've put it on the Provider so you can include it in the interface and enforce the interface for other providers people write. In that case, I guess I'm saying it seems to make more sense on the Session if it has to be an instance method.
The text was updated successfully, but these errors were encountered: