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

Regression fix for request ID in refresh token flow #262

Merged
merged 1 commit into from Apr 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions request.go
Expand Up @@ -137,6 +137,7 @@ func (a *Request) Sanitize(allowedParameters []string) Requester {
}

*b = *a
b.ID = a.GetID()
b.Form = url.Values{}
for k := range a.Form {
if _, ok := allowed[k]; ok {
Expand Down
15 changes: 15 additions & 0 deletions request_test.go
Expand Up @@ -99,3 +99,18 @@ func TestSanitizeRequest(t *testing.T) {
assert.Equal(t, "fasdf", a.GetRequestForm().Get("baz"))
assert.Equal(t, "fasdf", a.GetRequestForm().Get("foo"))
}

func TestIdentifyRequest(t *testing.T) {
a := &Request{
RequestedAt: time.Now().UTC(),
Client: &DefaultClient{},
Scopes: Arguments{},
GrantedScopes: []string{},
Form: url.Values{"foo": []string{"bar"}},
Session: new(DefaultSession),
}

b := a.Sanitize([]string{})
b.GetID()
assert.Equal(t, a.ID, b.GetID())
}