Documentation ¶
Index ¶
- Constants
- func GetStandardTimetableData(data *DataTemplate, timetabletype string, query *ent.TimetableQuery, ...) (int, error)
- func HasPublicRoute(routes []string) bool
- func RegisterOAuthAPI(r *chi.Mux, srv *Server) *chi.Mux
- type DataTemplate
- type Server
- type TimetableData
- type UserVerifier
- func (t *UserVerifier) AddClaims(tokenType oauth.TokenType, credential, tokenID, scope string, r *http.Request) (map[string]string, error)
- func (*UserVerifier) AddProperties(tokenType oauth.TokenType, credential, tokenID, scope string, r *http.Request) (map[string]string, error)
- func (*UserVerifier) StoreTokenID(tokenType oauth.TokenType, credential, tokenID, refreshTokenID string) error
- func (*UserVerifier) ValidateClient(clientID, clientSecret, scope string, r *http.Request) error
- func (*UserVerifier) ValidateCode(clientID, clientSecret, code, redirectURI string, r *http.Request) (string, error)
- func (*UserVerifier) ValidateTokenID(tokenType oauth.TokenType, credential, tokenID, refreshTokenID string) error
- func (t *UserVerifier) ValidateUser(username, password, scope string, r *http.Request) error
Constants ¶
View Source
const (
PublicAPIRoute = "/public"
)
Variables ¶
This section is empty.
Functions ¶
func GetStandardTimetableData ¶
func GetStandardTimetableData(data *DataTemplate, timetabletype string, query *ent.TimetableQuery, client *ent.Client, ctx context.Context) (int, error)
func HasPublicRoute ¶
func RegisterOAuthAPI ¶
func RegisterOAuthAPI(r *chi.Mux, srv *Server) *chi.Mux
Types ¶
type DataTemplate ¶
type DataTemplate struct { Title string Locale string TimetableTypeData []TimetableData }
type Server ¶
type Server struct { Client *ent.Client OAuthServer *oauth.BearerServer }
func (*Server) Timetables ¶
func (s *Server) Timetables(w http.ResponseWriter, r *http.Request)
type TimetableData ¶
type UserVerifier ¶
UserVerifier provides user credentials verifier for testing.
func (*UserVerifier) AddClaims ¶
func (t *UserVerifier) AddClaims(tokenType oauth.TokenType, credential, tokenID, scope string, r *http.Request) (map[string]string, error)
AddClaims provides additional claims to the token
func (*UserVerifier) AddProperties ¶
func (*UserVerifier) AddProperties(tokenType oauth.TokenType, credential, tokenID, scope string, r *http.Request) (map[string]string, error)
AddProperties provides additional information to the token response
func (*UserVerifier) StoreTokenID ¶
func (*UserVerifier) StoreTokenID(tokenType oauth.TokenType, credential, tokenID, refreshTokenID string) error
StoreTokenID saves the token id generated for the user
func (*UserVerifier) ValidateClient ¶
func (*UserVerifier) ValidateClient(clientID, clientSecret, scope string, r *http.Request) error
ValidateClient validates clientID and secret returning an error if the client credentials are wrong
func (*UserVerifier) ValidateCode ¶
func (*UserVerifier) ValidateCode(clientID, clientSecret, code, redirectURI string, r *http.Request) (string, error)
ValidateCode validates token ID
func (*UserVerifier) ValidateTokenID ¶
func (*UserVerifier) ValidateTokenID(tokenType oauth.TokenType, credential, tokenID, refreshTokenID string) error
ValidateTokenID validates token ID
func (*UserVerifier) ValidateUser ¶
func (t *UserVerifier) ValidateUser(username, password, scope string, r *http.Request) error
ValidateUser validates username and password returning an error if the user credentials are wrong
Click to show internal directories.
Click to hide internal directories.