mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-28 04:35:40 +00:00
* refactor: return all values from body in the providers * refactor: only accept claims following the OIDC spec * feat: map info from OIDC claims to headers * feat: add support for required oauth groups * fix: bot suggestions * feat: get claims from github and google * fix: close body correctly
60 lines
1.8 KiB
Go
60 lines
1.8 KiB
Go
package types
|
|
|
|
// LoginQuery is the query parameters for the login endpoint
|
|
type LoginQuery struct {
|
|
RedirectURI string `url:"redirect_uri"`
|
|
}
|
|
|
|
// LoginRequest is the request body for the login endpoint
|
|
type LoginRequest struct {
|
|
Username string `json:"username"`
|
|
Password string `json:"password"`
|
|
}
|
|
|
|
// OAuthRequest is the request for the OAuth endpoint
|
|
type OAuthRequest struct {
|
|
Provider string `uri:"provider" binding:"required"`
|
|
}
|
|
|
|
// UnauthorizedQuery is the query parameters for the unauthorized endpoint
|
|
type UnauthorizedQuery struct {
|
|
Username string `url:"username"`
|
|
Resource string `url:"resource"`
|
|
GroupErr bool `url:"groupErr"`
|
|
}
|
|
|
|
// Proxy is the uri parameters for the proxy endpoint
|
|
type Proxy struct {
|
|
Proxy string `uri:"proxy" binding:"required"`
|
|
}
|
|
|
|
// User Context response is the response for the user context endpoint
|
|
type UserContextResponse struct {
|
|
Status int `json:"status"`
|
|
Message string `json:"message"`
|
|
IsLoggedIn bool `json:"isLoggedIn"`
|
|
Username string `json:"username"`
|
|
Name string `json:"name"`
|
|
Email string `json:"email"`
|
|
Provider string `json:"provider"`
|
|
Oauth bool `json:"oauth"`
|
|
TotpPending bool `json:"totpPending"`
|
|
}
|
|
|
|
// App Context is the response for the app context endpoint
|
|
type AppContext struct {
|
|
Status int `json:"status"`
|
|
Message string `json:"message"`
|
|
ConfiguredProviders []string `json:"configuredProviders"`
|
|
DisableContinue bool `json:"disableContinue"`
|
|
Title string `json:"title"`
|
|
GenericName string `json:"genericName"`
|
|
Domain string `json:"domain"`
|
|
ForgotPasswordMessage string `json:"forgotPasswordMessage"`
|
|
}
|
|
|
|
// Totp request is the request for the totp endpoint
|
|
type TotpRequest struct {
|
|
Code string `json:"code"`
|
|
}
|