Skip to content

Commit

Permalink
fix: mark identity as optional in session struct
Browse files Browse the repository at this point in the history
The identity is not always available in the session struct, for example when AAL2 is required.

Closes #3461
  • Loading branch information
aeneasr committed Aug 29, 2023
1 parent eaaf375 commit b9da094
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 33 deletions.
35 changes: 21 additions & 14 deletions internal/client-go/model_session.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 21 additions & 14 deletions internal/httpclient/model_session.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ type Session struct {
// Use this token to log out a user.
LogoutToken string `json:"-" db:"logout_token"`

// required: true
// The Session Identity
//
// The identity that authenticated this session.
//
// If 2FA is required for the user, and the authentication process only solved the first factor, this field will be
// null until the session has been fully authenticated with the second factor.
Identity *identity.Identity `json:"identity" faker:"identity" db:"-" belongs_to:"identities" fk_id:"IdentityID"`

// Devices has history of all endpoints where the session was used
Expand Down
3 changes: 1 addition & 2 deletions spec/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1759,8 +1759,7 @@
}
},
"required": [
"id",
"identity"
"id"
],
"type": "object"
},
Expand Down
3 changes: 1 addition & 2 deletions spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4638,8 +4638,7 @@
"description": "A Session",
"type": "object",
"required": [
"id",
"identity"
"id"
],
"properties": {
"active": {
Expand Down

0 comments on commit b9da094

Please sign in to comment.