mirror of
				https://github.com/steveiliop56/tinyauth.git
				synced 2025-11-04 08:05:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			55 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			1.6 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"`
 | 
						|
}
 | 
						|
 | 
						|
// 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"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// Totp request is the request for the totp endpoint
 | 
						|
type TotpRequest struct {
 | 
						|
	Code string `json:"code"`
 | 
						|
}
 |