Files
pocket-id-pocket-id-2/backend/internal/dto/oidc_dto.go

43 lines
1.3 KiB
Go
Raw Normal View History

2024-08-23 17:04:19 +02:00
package dto
type PublicOidcClientDto struct {
ID string `json:"id"`
Name string `json:"name"`
HasLogo bool `json:"hasLogo"`
2024-08-23 17:04:19 +02:00
}
type OidcClientDto struct {
PublicOidcClientDto
CallbackURLs []string `json:"callbackURLs"`
2024-11-15 15:00:25 +01:00
IsPublic bool `json:"isPublic"`
2024-08-23 17:04:19 +02:00
CreatedBy UserDto `json:"createdBy"`
}
type OidcClientCreateDto struct {
Name string `json:"name" binding:"required,max=50"`
CallbackURLs []string `json:"callbackURLs" binding:"required,urlList"`
2024-11-15 15:00:25 +01:00
IsPublic bool `json:"isPublic"`
2024-08-23 17:04:19 +02:00
}
type AuthorizeOidcClientRequestDto struct {
2024-11-15 15:00:25 +01:00
ClientID string `json:"clientID" binding:"required"`
Scope string `json:"scope" binding:"required"`
CallbackURL string `json:"callbackURL"`
Nonce string `json:"nonce"`
CodeChallenge string `json:"codeChallenge"`
CodeChallengeMethod string `json:"codeChallengeMethod"`
}
type AuthorizeOidcClientResponseDto struct {
Code string `json:"code"`
CallbackURL string `json:"callbackURL"`
2024-08-23 17:04:19 +02:00
}
2024-11-15 15:00:25 +01:00
type OidcCreateTokensDto struct {
2024-08-23 17:04:19 +02:00
GrantType string `form:"grant_type" binding:"required"`
Code string `form:"code" binding:"required"`
ClientID string `form:"client_id"`
ClientSecret string `form:"client_secret"`
2024-11-15 15:00:25 +01:00
CodeVerifier string `form:"code_verifier"`
2024-08-23 17:04:19 +02:00
}