Skip to content
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

sso-proxy: remove default provider and unused functions #87

Merged
merged 1 commit into from
Nov 5, 2018

Conversation

shrayolacrayon
Copy link

@shrayolacrayon shrayolacrayon commented Oct 5, 2018

What

Some refactoring to make moving sso-proxy to use Sessions.SessionStore easier. This deletes the provider_default in sso-proxy and moves creating the full SignInURL and SignOutURL into providers package functions rather than being part of the interface.

cc @buzzfeed/sso-maintainers

katzdm
katzdm previously approved these changes Oct 18, 2018

// GetSignInURL with typical oauth parameters
func (p *SSOProvider) GetSignInURL(redirectURL *url.URL, state string) *url.URL {
var a url.URL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Unless I'm missing a reason not to, let's write a := *p.Data().SignInURL() for consistency.

Also in GetSignOutURL() below.

@@ -383,3 +386,43 @@ func (p *SSOProvider) ValidateSessionState(s *SessionState, allowedGroups []stri

return true
}

// signRedirectURL signs the redirect url string, given a timestamp, and returns it
func signRedirectURL(clientSecret, rawRedirect string, timestamp time.Time) string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I always double take when reading through code that uses this syntax pattern - Would you mind explicitly spelling the type string alongside clientSecret?

func signRedirectURL(clientSecret string, rawRedirect string, timestamp time.Time) string {

Copy link
Contributor

@loganmeetsworld loganmeetsworld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM

@shrayolacrayon shrayolacrayon merged commit 91df331 into master Nov 5, 2018
@shrayolacrayon shrayolacrayon deleted the proxy-remove-default-provider branch November 5, 2018 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants