Documentation
¶
Overview ¶
Package auth provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.8.3 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type ChiServerOptions
- type ClientIdQueryParam
- type MiddlewareFunc
- type OAuth2GoogleCallbackPayload
- type Oauth2GoogleAuthorizationParams
- type Oauth2GoogleCallbackJSONBody
- type Oauth2GoogleCallbackJSONRequestBody
- type OidcAuthorizationParams
- type OidcCallbackJSONBody
- type OidcCallbackJSONRequestBody
- type OidcCallbackPayload
- type RedirectUriQueryParam
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) Oauth2GoogleAuthorization(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) Oauth2GoogleCallback(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) OidcAuthorization(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) OidcCallback(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SigninEmail(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) Signout(w http.ResponseWriter, r *http.Request)
- type SigninEmailJSONBody
- type SigninEmailJSONRequestBody
- type SigninEmailPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type ChiServerOptions ¶
type ChiServerOptions struct {
BaseURL string
BaseRouter chi.Router
Middlewares []MiddlewareFunc
}
type ClientIdQueryParam ¶
type ClientIdQueryParam string
ClientIdQueryParam defines model for ClientIdQueryParam.
type MiddlewareFunc ¶
type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc
type OAuth2GoogleCallbackPayload ¶
type OAuth2GoogleCallbackPayload struct {
// GoogleOAuth2クライアントID
ClientId string `json:"clientId"`
// Googleが発行した認可コード
Code string `json:"code"`
// GoogleOAuth2コールバックURI
RedirectUri string `json:"redirectUri"`
// CSRF対策用のステートパラメータ
State string `json:"state"`
}
OAuth2GoogleCallbackPayload defines model for OAuth2GoogleCallbackPayload.
type Oauth2GoogleAuthorizationParams ¶
type Oauth2GoogleAuthorizationParams struct {
RedirectUri RedirectUriQueryParam `json:"redirectUri"`
ClientId ClientIdQueryParam `json:"clientId"`
}
Oauth2GoogleAuthorizationParams defines parameters for Oauth2GoogleAuthorization.
type Oauth2GoogleCallbackJSONBody ¶
type Oauth2GoogleCallbackJSONBody OAuth2GoogleCallbackPayload
Oauth2GoogleCallbackJSONBody defines parameters for Oauth2GoogleCallback.
type Oauth2GoogleCallbackJSONRequestBody ¶
type Oauth2GoogleCallbackJSONRequestBody Oauth2GoogleCallbackJSONBody
Oauth2GoogleCallbackJSONRequestBody defines body for Oauth2GoogleCallback for application/json ContentType.
type OidcAuthorizationParams ¶
type OidcAuthorizationParams struct {
RedirectUri RedirectUriQueryParam `json:"redirectUri"`
ClientId ClientIdQueryParam `json:"clientId"`
}
OidcAuthorizationParams defines parameters for OidcAuthorization.
type OidcCallbackJSONBody ¶
type OidcCallbackJSONBody OidcCallbackPayload
OidcCallbackJSONBody defines parameters for OidcCallback.
type OidcCallbackJSONRequestBody ¶
type OidcCallbackJSONRequestBody OidcCallbackJSONBody
OidcCallbackJSONRequestBody defines body for OidcCallback for application/json ContentType.
type OidcCallbackPayload ¶
type OidcCallbackPayload struct {
// OIDCクライアントID
ClientId string `json:"clientId"`
// OIDC Idpが発行した認可コード
Code string `json:"code"`
// OIDCコールバックURI
RedirectUri string `json:"redirectUri"`
// CSRF対策用のステートパラメータ
State string `json:"state"`
}
OidcCallbackPayload defines model for OidcCallbackPayload.
type RedirectUriQueryParam ¶
type RedirectUriQueryParam string
RedirectUriQueryParam defines model for RedirectUriQueryParam.
type ServerInterface ¶
type ServerInterface interface {
// signin to viron with email/password
// (POST /email/signin)
SigninEmail(w http.ResponseWriter, r *http.Request)
// redirect to google oauth
// (GET /oauth2/google/authorization)
Oauth2GoogleAuthorization(w http.ResponseWriter, r *http.Request, params Oauth2GoogleAuthorizationParams)
// callback from google oauth
// (POST /oauth2/google/callback)
Oauth2GoogleCallback(w http.ResponseWriter, r *http.Request)
// redirect to oidc idp authorization
// (GET /oidc/authorization)
OidcAuthorization(w http.ResponseWriter, r *http.Request, params OidcAuthorizationParams)
// callback from oidc idp
// (POST /oidc/callback)
OidcCallback(w http.ResponseWriter, r *http.Request)
// signout of viron
// (POST /signout)
Signout(w http.ResponseWriter, r *http.Request)
}
ServerInterface represents all server handlers.
func New ¶
func New(domainAuth *auth.Auth) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) Oauth2GoogleAuthorization ¶
func (siw *ServerInterfaceWrapper) Oauth2GoogleAuthorization(w http.ResponseWriter, r *http.Request)
Oauth2GoogleAuthorization operation middleware
func (*ServerInterfaceWrapper) Oauth2GoogleCallback ¶
func (siw *ServerInterfaceWrapper) Oauth2GoogleCallback(w http.ResponseWriter, r *http.Request)
Oauth2GoogleCallback operation middleware
func (*ServerInterfaceWrapper) OidcAuthorization ¶
func (siw *ServerInterfaceWrapper) OidcAuthorization(w http.ResponseWriter, r *http.Request)
OidcAuthorization operation middleware
func (*ServerInterfaceWrapper) OidcCallback ¶
func (siw *ServerInterfaceWrapper) OidcCallback(w http.ResponseWriter, r *http.Request)
OidcCallback operation middleware
func (*ServerInterfaceWrapper) SigninEmail ¶
func (siw *ServerInterfaceWrapper) SigninEmail(w http.ResponseWriter, r *http.Request)
SigninEmail operation middleware
func (*ServerInterfaceWrapper) Signout ¶
func (siw *ServerInterfaceWrapper) Signout(w http.ResponseWriter, r *http.Request)
Signout operation middleware
type SigninEmailJSONBody ¶
type SigninEmailJSONBody SigninEmailPayload
SigninEmailJSONBody defines parameters for SigninEmail.
type SigninEmailJSONRequestBody ¶
type SigninEmailJSONRequestBody SigninEmailJSONBody
SigninEmailJSONRequestBody defines body for SigninEmail for application/json ContentType.
type SigninEmailPayload ¶
type SigninEmailPayload struct {
// Eメールアドレス
Email openapi_types.Email `json:"email"`
// パスワード
Password string `json:"password"`
}
SigninEmailPayload defines model for SigninEmailPayload.