token tests

This commit is contained in:
tsmethurst 2021-09-02 12:22:09 +02:00
commit cc7a35ee92
2 changed files with 101 additions and 2 deletions

View file

@ -27,8 +27,8 @@ type Token struct {
UpdatedAt time.Time `validate:"-" bun:"type:timestamp,nullzero,notnull,default:current_timestamp"` // when was item last updated
ClientID string `validate:"required,ulid" bun:"type:CHAR(26),nullzero,notnull"` // ID of the client who owns this token
UserID string `validate:"required,ulid" bun:"type:CHAR(26),nullzero,notnull"` // ID of the user who owns this token
RedirectURI string `validate:"required,url" bun:",nullzero,notnull"` // Oauth redirect URI for this token
Scope string `validate:"omitempty,url" bun:",nullzero,notnull,default:'read'"` // Oauth scope
RedirectURI string `validate:"required,uri" bun:",nullzero,notnull"` // Oauth redirect URI for this token
Scope string `validate:"omitempty" bun:",nullzero,notnull,default:'read'"` // Oauth scope
Code string `validate:"-" bun:",pk,nullzero,notnull,default:''"` // Code, if present
CodeChallenge string `validate:"-" bun:",nullzero"` // Code challenge, if code present
CodeChallengeMethod string `validate:"-" bun:",nullzero"` // Code challenge method, if code present