Skip to content

Commit

Permalink
fix: Merge request ID as well
Browse files Browse the repository at this point in the history
Closes #386
  • Loading branch information
aeneasr committed Mar 2, 2020
1 parent 387cade commit 8ef2cdb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions request.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ func (a *Request) Merge(request Requester) {
a.GrantAudience(aud)
}

a.ID = request.GetID()
a.RequestedAt = request.GetRequestedAt()
a.Client = request.GetClient()
a.Session = request.GetSession()
Expand Down
2 changes: 2 additions & 0 deletions request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func TestRequest(t *testing.T) {

func TestMergeRequest(t *testing.T) {
a := &Request{
ID: "123",
RequestedAt: time.Now().UTC(),
Client: &DefaultClient{ID: "123"},
RequestedScope: Arguments{"scope-3", "scope-4"},
Expand Down Expand Up @@ -80,6 +81,7 @@ func TestMergeRequest(t *testing.T) {
assert.EqualValues(t, a.GrantedAudience, b.GrantedAudience)
assert.EqualValues(t, a.Form, b.Form)
assert.EqualValues(t, a.Session, b.Session)
assert.EqualValues(t, a.ID, b.ID)
}

func TestSanitizeRequest(t *testing.T) {
Expand Down

0 comments on commit 8ef2cdb

Please sign in to comment.