Documentation
¶
Overview ¶
Package auth provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
Index ¶
- Constants
- func NewAuthorizeRequest(server string, params *AuthorizeParams) (*http.Request, error)
- func NewCreateOAuthApplicationRequest(server string, body CreateOAuthApplicationJSONRequestBody) (*http.Request, error)
- func NewCreateOAuthApplicationRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewDeleteOAuthApplicationRequest(server string, id string) (*http.Request, error)
- func NewGetOAuthApplicationRequest(server string, id string) (*http.Request, error)
- func NewListOAuthApplicationsRequest(server string) (*http.Request, error)
- func NewResetOAuthApplicationSecretRequest(server string, id string) (*http.Request, error)
- func NewRevokeOAuthApplicationTokensRequest(server string, id string) (*http.Request, error)
- func NewRevokeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewRevokeRequestWithFormdataBody(server string, body RevokeFormdataRequestBody) (*http.Request, error)
- func NewTokenRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewTokenRequestWithFormdataBody(server string, body TokenFormdataRequestBody) (*http.Request, error)
- func NewUpdateOAuthApplicationRequest(server string, id string, body UpdateOAuthApplicationJSONRequestBody) (*http.Request, error)
- func NewUpdateOAuthApplicationRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error)
- type AuthorizeHTTPResp
- type AuthorizeParams
- type AuthorizeParamsCodeChallengeMethod
- type AuthorizeParamsResponseType
- type Client
- func (c *Client) Authorize(ctx context.Context, params *AuthorizeParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) CreateOAuthApplication(ctx context.Context, body CreateOAuthApplicationJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) CreateOAuthApplicationWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) DeleteOAuthApplication(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetOAuthApplication(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListOAuthApplications(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ResetOAuthApplicationSecret(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) RevokeOAuthApplicationTokens(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) RevokeWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) RevokeWithFormdataBody(ctx context.Context, body RevokeFormdataRequestBody, ...) (*http.Response, error)
- func (c *Client) TokenWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) TokenWithFormdataBody(ctx context.Context, body TokenFormdataRequestBody, ...) (*http.Response, error)
- func (c *Client) UpdateOAuthApplication(ctx context.Context, id string, body UpdateOAuthApplicationJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) UpdateOAuthApplicationWithBody(ctx context.Context, id string, contentType string, body io.Reader, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) AuthorizeWithResponse(ctx context.Context, params *AuthorizeParams, reqEditors ...RequestEditorFn) (*AuthorizeHTTPResp, error)
- func (c *ClientWithResponses) CreateOAuthApplicationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*CreateOAuthApplicationHTTPResp, error)
- func (c *ClientWithResponses) CreateOAuthApplicationWithResponse(ctx context.Context, body CreateOAuthApplicationJSONRequestBody, ...) (*CreateOAuthApplicationHTTPResp, error)
- func (c *ClientWithResponses) DeleteOAuthApplicationWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteOAuthApplicationHTTPResp, error)
- func (c *ClientWithResponses) GetOAuthApplicationWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetOAuthApplicationHTTPResp, error)
- func (c *ClientWithResponses) ListOAuthApplicationsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListOAuthApplicationsHTTPResp, error)
- func (c *ClientWithResponses) ResetOAuthApplicationSecretWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*ResetOAuthApplicationSecretHTTPResp, error)
- func (c *ClientWithResponses) RevokeOAuthApplicationTokensWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RevokeOAuthApplicationTokensHTTPResp, error)
- func (c *ClientWithResponses) RevokeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*RevokeHTTPResp, error)
- func (c *ClientWithResponses) RevokeWithFormdataBodyWithResponse(ctx context.Context, body RevokeFormdataRequestBody, ...) (*RevokeHTTPResp, error)
- func (c *ClientWithResponses) TokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*TokenHTTPResp, error)
- func (c *ClientWithResponses) TokenWithFormdataBodyWithResponse(ctx context.Context, body TokenFormdataRequestBody, ...) (*TokenHTTPResp, error)
- func (c *ClientWithResponses) UpdateOAuthApplicationWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, ...) (*UpdateOAuthApplicationHTTPResp, error)
- func (c *ClientWithResponses) UpdateOAuthApplicationWithResponse(ctx context.Context, id string, body UpdateOAuthApplicationJSONRequestBody, ...) (*UpdateOAuthApplicationHTTPResp, error)
- type ClientWithResponsesInterface
- type CreateOAuthApplicationHTTPResp
- type CreateOAuthApplicationJSONRequestBody
- type DeleteOAuthApplicationHTTPResp
- type GetOAuthApplicationHTTPResp
- type HttpRequestDoer
- type ListOAuthApplicationsHTTPResp
- type OAuth2Error
- type OAuthApplication
- type OAuthApplicationCreateRequest
- type OAuthApplicationCreated
- type OAuthApplicationCreator
- type OAuthApplicationCreatorType
- type OAuthApplicationItem
- type OAuthApplicationList
- type OAuthApplicationSecret
- type OAuthApplicationUpdateRequest
- type OAuthRevokeRequest
- type OAuthRevokeRequestTokenTypeHint
- type OAuthTokenRequest
- type OAuthTokenRequestAccessType
- type OAuthTokenRequestGrantType
- type OAuthTokenRequestSubjectTokenType
- type OAuthTokenResponse
- type RequestEditorFn
- type ResetOAuthApplicationSecretHTTPResp
- type RevokeFormdataRequestBody
- type RevokeHTTPResp
- type RevokeOAuthApplicationTokensHTTPResp
- type TokenFormdataRequestBody
- type TokenHTTPResp
- type UpdateOAuthApplicationHTTPResp
- type UpdateOAuthApplicationJSONRequestBody
Constants ¶
const (
Oauth2Scopes = "oauth2.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func NewAuthorizeRequest ¶
func NewAuthorizeRequest(server string, params *AuthorizeParams) (*http.Request, error)
NewAuthorizeRequest generates requests for Authorize
func NewCreateOAuthApplicationRequest ¶ added in v0.47.0
func NewCreateOAuthApplicationRequest(server string, body CreateOAuthApplicationJSONRequestBody) (*http.Request, error)
NewCreateOAuthApplicationRequest calls the generic CreateOAuthApplication builder with application/json body
func NewCreateOAuthApplicationRequestWithBody ¶ added in v0.47.0
func NewCreateOAuthApplicationRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewCreateOAuthApplicationRequestWithBody generates requests for CreateOAuthApplication with any type of body
func NewDeleteOAuthApplicationRequest ¶ added in v0.47.0
NewDeleteOAuthApplicationRequest generates requests for DeleteOAuthApplication
func NewGetOAuthApplicationRequest ¶ added in v0.47.0
NewGetOAuthApplicationRequest generates requests for GetOAuthApplication
func NewListOAuthApplicationsRequest ¶ added in v0.47.0
NewListOAuthApplicationsRequest generates requests for ListOAuthApplications
func NewResetOAuthApplicationSecretRequest ¶ added in v0.47.0
NewResetOAuthApplicationSecretRequest generates requests for ResetOAuthApplicationSecret
func NewRevokeOAuthApplicationTokensRequest ¶ added in v0.47.0
NewRevokeOAuthApplicationTokensRequest generates requests for RevokeOAuthApplicationTokens
func NewRevokeRequestWithBody ¶
func NewRevokeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewRevokeRequestWithBody generates requests for Revoke with any type of body
func NewRevokeRequestWithFormdataBody ¶
func NewRevokeRequestWithFormdataBody(server string, body RevokeFormdataRequestBody) (*http.Request, error)
NewRevokeRequestWithFormdataBody calls the generic Revoke builder with application/x-www-form-urlencoded body
func NewTokenRequestWithBody ¶
func NewTokenRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewTokenRequestWithBody generates requests for Token with any type of body
func NewTokenRequestWithFormdataBody ¶
func NewTokenRequestWithFormdataBody(server string, body TokenFormdataRequestBody) (*http.Request, error)
NewTokenRequestWithFormdataBody calls the generic Token builder with application/x-www-form-urlencoded body
func NewUpdateOAuthApplicationRequest ¶ added in v0.47.0
func NewUpdateOAuthApplicationRequest(server string, id string, body UpdateOAuthApplicationJSONRequestBody) (*http.Request, error)
NewUpdateOAuthApplicationRequest calls the generic UpdateOAuthApplication builder with application/json body
func NewUpdateOAuthApplicationRequestWithBody ¶ added in v0.47.0
func NewUpdateOAuthApplicationRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error)
NewUpdateOAuthApplicationRequestWithBody generates requests for UpdateOAuthApplication with any type of body
Types ¶
type AuthorizeHTTPResp ¶
type AuthorizeHTTPResp struct {
Body []byte
HTTPResponse *http.Response
JSON400 *OAuth2Error
}
func ParseAuthorizeHTTPResp ¶
func ParseAuthorizeHTTPResp(rsp *http.Response) (*AuthorizeHTTPResp, error)
ParseAuthorizeHTTPResp parses an HTTP response from a AuthorizeWithResponse call
func (AuthorizeHTTPResp) Status ¶
func (r AuthorizeHTTPResp) Status() string
Status returns HTTPResponse.Status
func (AuthorizeHTTPResp) StatusCode ¶
func (r AuthorizeHTTPResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type AuthorizeParams ¶
type AuthorizeParams struct {
// ResponseType Must be `code` for the Authorization Code flow.
ResponseType AuthorizeParamsResponseType `form:"response_type" json:"response_type"`
ClientId string `form:"client_id" json:"client_id"`
// RedirectUri Must exactly match the client's registered callback URL.
RedirectUri string `form:"redirect_uri" json:"redirect_uri"`
// Scope Requested scope, e.g. `*` for all access.
Scope string `form:"scope" json:"scope"`
// State Opaque value returned unchanged in the redirect; use it for CSRF protection.
State *string `form:"state,omitempty" json:"state,omitempty"`
// CodeChallenge PKCE code challenge (RFC 7636). Required for public clients.
CodeChallenge *string `form:"code_challenge,omitempty" json:"code_challenge,omitempty"`
// CodeChallengeMethod PKCE transformation. `S256` is strongly recommended.
CodeChallengeMethod *AuthorizeParamsCodeChallengeMethod `form:"code_challenge_method,omitempty" json:"code_challenge_method,omitempty"`
}
AuthorizeParams defines parameters for Authorize.
type AuthorizeParamsCodeChallengeMethod ¶
type AuthorizeParamsCodeChallengeMethod string
AuthorizeParamsCodeChallengeMethod defines parameters for Authorize.
const ( Plain AuthorizeParamsCodeChallengeMethod = "plain" S256 AuthorizeParamsCodeChallengeMethod = "S256" )
Defines values for AuthorizeParamsCodeChallengeMethod.
type AuthorizeParamsResponseType ¶
type AuthorizeParamsResponseType string
AuthorizeParamsResponseType defines parameters for Authorize.
const (
Code AuthorizeParamsResponseType = "code"
)
Defines values for AuthorizeParamsResponseType.
type Client ¶
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) Authorize ¶
func (c *Client) Authorize(ctx context.Context, params *AuthorizeParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) CreateOAuthApplication ¶ added in v0.47.0
func (c *Client) CreateOAuthApplication(ctx context.Context, body CreateOAuthApplicationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) CreateOAuthApplicationWithBody ¶ added in v0.47.0
func (*Client) DeleteOAuthApplication ¶ added in v0.47.0
func (*Client) GetOAuthApplication ¶ added in v0.47.0
func (*Client) ListOAuthApplications ¶ added in v0.47.0
func (*Client) ResetOAuthApplicationSecret ¶ added in v0.47.0
func (*Client) RevokeOAuthApplicationTokens ¶ added in v0.47.0
func (*Client) RevokeWithBody ¶
func (*Client) RevokeWithFormdataBody ¶
func (c *Client) RevokeWithFormdataBody(ctx context.Context, body RevokeFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) TokenWithBody ¶
func (*Client) TokenWithFormdataBody ¶
func (c *Client) TokenWithFormdataBody(ctx context.Context, body TokenFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) UpdateOAuthApplication ¶ added in v0.47.0
func (c *Client) UpdateOAuthApplication(ctx context.Context, id string, body UpdateOAuthApplicationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface {
// ListOAuthApplications request
ListOAuthApplications(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateOAuthApplicationWithBody request with any body
CreateOAuthApplicationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateOAuthApplication(ctx context.Context, body CreateOAuthApplicationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteOAuthApplication request
DeleteOAuthApplication(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetOAuthApplication request
GetOAuthApplication(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
// UpdateOAuthApplicationWithBody request with any body
UpdateOAuthApplicationWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
UpdateOAuthApplication(ctx context.Context, id string, body UpdateOAuthApplicationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ResetOAuthApplicationSecret request
ResetOAuthApplicationSecret(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
// RevokeOAuthApplicationTokens request
RevokeOAuthApplicationTokens(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
// Authorize request
Authorize(ctx context.Context, params *AuthorizeParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// RevokeWithBody request with any body
RevokeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
RevokeWithFormdataBody(ctx context.Context, body RevokeFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// TokenWithBody request with any body
TokenWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
TokenWithFormdataBody(ctx context.Context, body TokenFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) AuthorizeWithResponse ¶
func (c *ClientWithResponses) AuthorizeWithResponse(ctx context.Context, params *AuthorizeParams, reqEditors ...RequestEditorFn) (*AuthorizeHTTPResp, error)
AuthorizeWithResponse request returning *AuthorizeHTTPResp
func (*ClientWithResponses) CreateOAuthApplicationWithBodyWithResponse ¶ added in v0.47.0
func (c *ClientWithResponses) CreateOAuthApplicationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOAuthApplicationHTTPResp, error)
CreateOAuthApplicationWithBodyWithResponse request with arbitrary body returning *CreateOAuthApplicationHTTPResp
func (*ClientWithResponses) CreateOAuthApplicationWithResponse ¶ added in v0.47.0
func (c *ClientWithResponses) CreateOAuthApplicationWithResponse(ctx context.Context, body CreateOAuthApplicationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOAuthApplicationHTTPResp, error)
func (*ClientWithResponses) DeleteOAuthApplicationWithResponse ¶ added in v0.47.0
func (c *ClientWithResponses) DeleteOAuthApplicationWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteOAuthApplicationHTTPResp, error)
DeleteOAuthApplicationWithResponse request returning *DeleteOAuthApplicationHTTPResp
func (*ClientWithResponses) GetOAuthApplicationWithResponse ¶ added in v0.47.0
func (c *ClientWithResponses) GetOAuthApplicationWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetOAuthApplicationHTTPResp, error)
GetOAuthApplicationWithResponse request returning *GetOAuthApplicationHTTPResp
func (*ClientWithResponses) ListOAuthApplicationsWithResponse ¶ added in v0.47.0
func (c *ClientWithResponses) ListOAuthApplicationsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListOAuthApplicationsHTTPResp, error)
ListOAuthApplicationsWithResponse request returning *ListOAuthApplicationsHTTPResp
func (*ClientWithResponses) ResetOAuthApplicationSecretWithResponse ¶ added in v0.47.0
func (c *ClientWithResponses) ResetOAuthApplicationSecretWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*ResetOAuthApplicationSecretHTTPResp, error)
ResetOAuthApplicationSecretWithResponse request returning *ResetOAuthApplicationSecretHTTPResp
func (*ClientWithResponses) RevokeOAuthApplicationTokensWithResponse ¶ added in v0.47.0
func (c *ClientWithResponses) RevokeOAuthApplicationTokensWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RevokeOAuthApplicationTokensHTTPResp, error)
RevokeOAuthApplicationTokensWithResponse request returning *RevokeOAuthApplicationTokensHTTPResp
func (*ClientWithResponses) RevokeWithBodyWithResponse ¶
func (c *ClientWithResponses) RevokeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RevokeHTTPResp, error)
RevokeWithBodyWithResponse request with arbitrary body returning *RevokeHTTPResp
func (*ClientWithResponses) RevokeWithFormdataBodyWithResponse ¶
func (c *ClientWithResponses) RevokeWithFormdataBodyWithResponse(ctx context.Context, body RevokeFormdataRequestBody, reqEditors ...RequestEditorFn) (*RevokeHTTPResp, error)
func (*ClientWithResponses) TokenWithBodyWithResponse ¶
func (c *ClientWithResponses) TokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TokenHTTPResp, error)
TokenWithBodyWithResponse request with arbitrary body returning *TokenHTTPResp
func (*ClientWithResponses) TokenWithFormdataBodyWithResponse ¶
func (c *ClientWithResponses) TokenWithFormdataBodyWithResponse(ctx context.Context, body TokenFormdataRequestBody, reqEditors ...RequestEditorFn) (*TokenHTTPResp, error)
func (*ClientWithResponses) UpdateOAuthApplicationWithBodyWithResponse ¶ added in v0.47.0
func (c *ClientWithResponses) UpdateOAuthApplicationWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateOAuthApplicationHTTPResp, error)
UpdateOAuthApplicationWithBodyWithResponse request with arbitrary body returning *UpdateOAuthApplicationHTTPResp
func (*ClientWithResponses) UpdateOAuthApplicationWithResponse ¶ added in v0.47.0
func (c *ClientWithResponses) UpdateOAuthApplicationWithResponse(ctx context.Context, id string, body UpdateOAuthApplicationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateOAuthApplicationHTTPResp, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// ListOAuthApplicationsWithResponse request
ListOAuthApplicationsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListOAuthApplicationsHTTPResp, error)
// CreateOAuthApplicationWithBodyWithResponse request with any body
CreateOAuthApplicationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOAuthApplicationHTTPResp, error)
CreateOAuthApplicationWithResponse(ctx context.Context, body CreateOAuthApplicationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOAuthApplicationHTTPResp, error)
// DeleteOAuthApplicationWithResponse request
DeleteOAuthApplicationWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteOAuthApplicationHTTPResp, error)
// GetOAuthApplicationWithResponse request
GetOAuthApplicationWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetOAuthApplicationHTTPResp, error)
// UpdateOAuthApplicationWithBodyWithResponse request with any body
UpdateOAuthApplicationWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateOAuthApplicationHTTPResp, error)
UpdateOAuthApplicationWithResponse(ctx context.Context, id string, body UpdateOAuthApplicationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateOAuthApplicationHTTPResp, error)
// ResetOAuthApplicationSecretWithResponse request
ResetOAuthApplicationSecretWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*ResetOAuthApplicationSecretHTTPResp, error)
// RevokeOAuthApplicationTokensWithResponse request
RevokeOAuthApplicationTokensWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RevokeOAuthApplicationTokensHTTPResp, error)
// AuthorizeWithResponse request
AuthorizeWithResponse(ctx context.Context, params *AuthorizeParams, reqEditors ...RequestEditorFn) (*AuthorizeHTTPResp, error)
// RevokeWithBodyWithResponse request with any body
RevokeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RevokeHTTPResp, error)
RevokeWithFormdataBodyWithResponse(ctx context.Context, body RevokeFormdataRequestBody, reqEditors ...RequestEditorFn) (*RevokeHTTPResp, error)
// TokenWithBodyWithResponse request with any body
TokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TokenHTTPResp, error)
TokenWithFormdataBodyWithResponse(ctx context.Context, body TokenFormdataRequestBody, reqEditors ...RequestEditorFn) (*TokenHTTPResp, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type CreateOAuthApplicationHTTPResp ¶ added in v0.47.0
type CreateOAuthApplicationHTTPResp struct {
Body []byte
HTTPResponse *http.Response
JSON201 *OAuthApplicationCreated
JSON400 *map[string]interface{}
JSON403 *OAuth2Error
}
func ParseCreateOAuthApplicationHTTPResp ¶ added in v0.47.0
func ParseCreateOAuthApplicationHTTPResp(rsp *http.Response) (*CreateOAuthApplicationHTTPResp, error)
ParseCreateOAuthApplicationHTTPResp parses an HTTP response from a CreateOAuthApplicationWithResponse call
func (CreateOAuthApplicationHTTPResp) Status ¶ added in v0.47.0
func (r CreateOAuthApplicationHTTPResp) Status() string
Status returns HTTPResponse.Status
func (CreateOAuthApplicationHTTPResp) StatusCode ¶ added in v0.47.0
func (r CreateOAuthApplicationHTTPResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type CreateOAuthApplicationJSONRequestBody ¶ added in v0.47.0
type CreateOAuthApplicationJSONRequestBody = OAuthApplicationCreateRequest
CreateOAuthApplicationJSONRequestBody defines body for CreateOAuthApplication for application/json ContentType.
type DeleteOAuthApplicationHTTPResp ¶ added in v0.47.0
type DeleteOAuthApplicationHTTPResp struct {
Body []byte
HTTPResponse *http.Response
JSON200 *map[string]interface{}
JSON403 *OAuth2Error
JSON404 *OAuth2Error
}
func ParseDeleteOAuthApplicationHTTPResp ¶ added in v0.47.0
func ParseDeleteOAuthApplicationHTTPResp(rsp *http.Response) (*DeleteOAuthApplicationHTTPResp, error)
ParseDeleteOAuthApplicationHTTPResp parses an HTTP response from a DeleteOAuthApplicationWithResponse call
func (DeleteOAuthApplicationHTTPResp) Status ¶ added in v0.47.0
func (r DeleteOAuthApplicationHTTPResp) Status() string
Status returns HTTPResponse.Status
func (DeleteOAuthApplicationHTTPResp) StatusCode ¶ added in v0.47.0
func (r DeleteOAuthApplicationHTTPResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetOAuthApplicationHTTPResp ¶ added in v0.47.0
type GetOAuthApplicationHTTPResp struct {
Body []byte
HTTPResponse *http.Response
JSON200 *OAuthApplicationItem
JSON404 *OAuth2Error
}
func ParseGetOAuthApplicationHTTPResp ¶ added in v0.47.0
func ParseGetOAuthApplicationHTTPResp(rsp *http.Response) (*GetOAuthApplicationHTTPResp, error)
ParseGetOAuthApplicationHTTPResp parses an HTTP response from a GetOAuthApplicationWithResponse call
func (GetOAuthApplicationHTTPResp) Status ¶ added in v0.47.0
func (r GetOAuthApplicationHTTPResp) Status() string
Status returns HTTPResponse.Status
func (GetOAuthApplicationHTTPResp) StatusCode ¶ added in v0.47.0
func (r GetOAuthApplicationHTTPResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type ListOAuthApplicationsHTTPResp ¶ added in v0.47.0
type ListOAuthApplicationsHTTPResp struct {
Body []byte
HTTPResponse *http.Response
JSON200 *OAuthApplicationList
}
func ParseListOAuthApplicationsHTTPResp ¶ added in v0.47.0
func ParseListOAuthApplicationsHTTPResp(rsp *http.Response) (*ListOAuthApplicationsHTTPResp, error)
ParseListOAuthApplicationsHTTPResp parses an HTTP response from a ListOAuthApplicationsWithResponse call
func (ListOAuthApplicationsHTTPResp) Status ¶ added in v0.47.0
func (r ListOAuthApplicationsHTTPResp) Status() string
Status returns HTTPResponse.Status
func (ListOAuthApplicationsHTTPResp) StatusCode ¶ added in v0.47.0
func (r ListOAuthApplicationsHTTPResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type OAuth2Error ¶
type OAuth2Error struct {
// Error RFC 6749 error code, e.g. invalid_grant, invalid_client, invalid_request.
Error string `json:"error"`
ErrorDescription *string `json:"error_description,omitempty"`
// State Echoed from the request when present.
State *string `json:"state,omitempty"`
}
OAuth2Error defines model for OAuth2Error.
type OAuthApplication ¶ added in v0.47.0
type OAuthApplication struct {
// ActiveTokenCount Active tokens of the application in the caller's account.
ActiveTokenCount *int64 `json:"activeTokenCount,omitempty"`
ClientId string `json:"clientId"`
// CreatedBy Who created the application; null for an application created before this was recorded.
CreatedBy *OAuthApplicationCreator `json:"createdBy"`
HomepageUri *string `json:"homepageUri"`
// Id The application's id (its uuid).
Id string `json:"id"`
Label *string `json:"label"`
Name string `json:"name"`
// Partner Set on a partner or babelforce application that belongs to no account.
Partner *string `json:"partner"`
PublicClient *bool `json:"publicClient,omitempty"`
RedirectUri *string `json:"redirectUri"`
}
OAuthApplication defines model for OAuthApplication.
type OAuthApplicationCreateRequest ¶ added in v0.47.0
type OAuthApplicationCreateRequest struct {
HomepageUri *string `json:"homepage_uri,omitempty"`
// Label A display label.
Label string `json:"label"`
// Name The application's name.
Name string `json:"name"`
// PublicClient Register a public client (no usable secret; the Authorization Code grant is authenticated with PKCE). Public clients cannot use `client_credentials`.
PublicClient *bool `json:"public_client,omitempty"`
// RedirectUri The callback URL of the Authorization Code flow. Required even for an application that only uses `client_credentials`.
RedirectUri string `json:"redirect_uri"`
// Scope The scopes the application holds, space-separated; `account:manage` when absent. At most what `account:manage` implies (`api:*`, `oauth:applications:*`), and for a service token caller at most what its own token holds.
Scope *string `json:"scope,omitempty"`
// ServiceTokenTtlSeconds Lifetime of the application's service tokens, and the most a token request may ask for.
ServiceTokenTtlSeconds *int `json:"service_token_ttl_seconds,omitempty"`
}
OAuthApplicationCreateRequest defines model for OAuthApplicationCreateRequest.
type OAuthApplicationCreated ¶ added in v0.47.0
type OAuthApplicationCreated struct {
ClientId string `json:"client_id"`
// ClientSecret Shown once, here. No read returns it again.
ClientSecret string `json:"client_secret"`
// Roles The roles the application's service tokens hold in the account: `MANAGER` with `account:manage`, none otherwise.
Roles []string `json:"roles"`
ServiceTokenTtlSeconds int `json:"service_token_ttl_seconds"`
// Uuid The application's id in `/oauth/applications/{id}`.
Uuid string `json:"uuid"`
}
OAuthApplicationCreated defines model for OAuthApplicationCreated.
type OAuthApplicationCreator ¶ added in v0.47.0
type OAuthApplicationCreator struct {
// Id The creating application's or user's uuid.
Id string `json:"id"`
// Type `application` for a service token, `user` for a person.
Type OAuthApplicationCreatorType `json:"type"`
}
OAuthApplicationCreator Who created the application; null for an application created before this was recorded.
type OAuthApplicationCreatorType ¶ added in v0.47.0
type OAuthApplicationCreatorType string
OAuthApplicationCreatorType `application` for a service token, `user` for a person.
const ( Application OAuthApplicationCreatorType = "application" User OAuthApplicationCreatorType = "user" )
Defines values for OAuthApplicationCreatorType.
type OAuthApplicationItem ¶ added in v0.47.0
type OAuthApplicationItem struct {
Application OAuthApplication `json:"application"`
}
OAuthApplicationItem defines model for OAuthApplicationItem.
type OAuthApplicationList ¶ added in v0.47.0
type OAuthApplicationList struct {
Items []OAuthApplication `json:"items"`
}
OAuthApplicationList defines model for OAuthApplicationList.
type OAuthApplicationSecret ¶ added in v0.47.0
type OAuthApplicationSecret struct {
// ClientSecret The new secret, shown once.
ClientSecret string `json:"client_secret"`
}
OAuthApplicationSecret defines model for OAuthApplicationSecret.
type OAuthApplicationUpdateRequest ¶ added in v0.47.0
type OAuthApplicationUpdateRequest struct {
HomepageUri *string `json:"homepage_uri,omitempty"`
Label string `json:"label"`
Name string `json:"name"`
RedirectUri string `json:"redirect_uri"`
}
OAuthApplicationUpdateRequest defines model for OAuthApplicationUpdateRequest.
type OAuthRevokeRequest ¶
type OAuthRevokeRequest struct {
// ClientId Optional; validated when supplied.
ClientId *string `json:"client_id,omitempty"`
// ClientSecret Required with client_id for confidential clients.
ClientSecret *string `json:"client_secret,omitempty"`
// Token The access_token or refresh_token to revoke.
Token string `json:"token"`
// TokenTypeHint Optional optimization hint (RFC 7009 §2.1).
TokenTypeHint *OAuthRevokeRequestTokenTypeHint `json:"token_type_hint,omitempty"`
}
OAuthRevokeRequest defines model for OAuthRevokeRequest.
type OAuthRevokeRequestTokenTypeHint ¶
type OAuthRevokeRequestTokenTypeHint string
OAuthRevokeRequestTokenTypeHint Optional optimization hint (RFC 7009 §2.1).
const ( OAuthRevokeRequestTokenTypeHintAccessToken OAuthRevokeRequestTokenTypeHint = "access_token" OAuthRevokeRequestTokenTypeHintRefreshToken OAuthRevokeRequestTokenTypeHint = "refresh_token" )
Defines values for OAuthRevokeRequestTokenTypeHint.
type OAuthTokenRequest ¶
type OAuthTokenRequest struct {
// AccessType `offline` (default for authorization_code) also returns a refresh_token.
AccessType *OAuthTokenRequestAccessType `json:"access_type,omitempty"`
// AccountId `refresh_token`: switch the refreshed token to another account the user may act in (one listed by `GET /api/v2/user/accounts`); refused otherwise. `client_credentials`: must equal the application's own account when sent.
AccountId *string `json:"account_id,omitempty"`
// Audience Token exchange only — the direct sub-account the issued token acts in, named by its account id (uuid) or its `orgKey`.
Audience *string `json:"audience,omitempty"`
// ClientId Required for `authorization_code`, `client_credentials` and the token exchange, unless the client authenticates with HTTP Basic.
ClientId *string `json:"client_id,omitempty"`
// ClientSecret Required for confidential clients (unless sent as HTTP Basic); omitted by public clients (which use PKCE).
ClientSecret *string `json:"client_secret,omitempty"`
// Code `authorization_code` only — the code returned by /oauth/authorize.
Code *string `json:"code,omitempty"`
// CodeVerifier `authorization_code` with PKCE (RFC 7636) — required for public clients.
CodeVerifier *string `json:"code_verifier,omitempty"`
// ExpiresIn `client_credentials` with an application of an account: the requested lifetime in seconds, at most the application's `service_token_ttl_seconds`.
ExpiresIn *int64 `json:"expires_in,omitempty"`
// GrantType The OAuth 2.0 grant type.
GrantType OAuthTokenRequestGrantType `json:"grant_type"`
// Password `password` only — the user's password.
Password *string `json:"password,omitempty"`
// RedirectUri `authorization_code` only — must match the value used at /oauth/authorize.
RedirectUri *string `json:"redirect_uri,omitempty"`
// RefreshToken `refresh_token` only — the most recently issued refresh token (rotated each use).
RefreshToken *string `json:"refresh_token,omitempty"`
// Scope Requested scope, space-separated. For `authorization_code` the scope bound to the code always wins. For `client_credentials` a subset of the application's scopes; for the token exchange a subset of the subject token's scope.
Scope *string `json:"scope,omitempty"`
// SubjectToken Token exchange only — a service token of the authenticating application in its own account.
SubjectToken *string `json:"subject_token,omitempty"`
// SubjectTokenType Token exchange only — the type of `subject_token`; only an access token is exchanged.
SubjectTokenType *OAuthTokenRequestSubjectTokenType `json:"subject_token_type,omitempty"`
// Username `password` only — the user's email/username.
Username *string `json:"username,omitempty"`
}
OAuthTokenRequest defines model for OAuthTokenRequest.
type OAuthTokenRequestAccessType ¶
type OAuthTokenRequestAccessType string
OAuthTokenRequestAccessType `offline` (default for authorization_code) also returns a refresh_token.
const ( Offline OAuthTokenRequestAccessType = "offline" Online OAuthTokenRequestAccessType = "online" )
Defines values for OAuthTokenRequestAccessType.
type OAuthTokenRequestGrantType ¶
type OAuthTokenRequestGrantType string
OAuthTokenRequestGrantType The OAuth 2.0 grant type.
const ( OAuthTokenRequestGrantTypeAuthorizationCode OAuthTokenRequestGrantType = "authorization_code" OAuthTokenRequestGrantTypeClientCredentials OAuthTokenRequestGrantType = "client_credentials" OAuthTokenRequestGrantTypePassword OAuthTokenRequestGrantType = "password" OAuthTokenRequestGrantTypeRefreshToken OAuthTokenRequestGrantType = "refresh_token" OAuthTokenRequestGrantTypeUrnIetfParamsOauthGrantTypeTokenExchange OAuthTokenRequestGrantType = "urn:ietf:params:oauth:grant-type:token-exchange" )
Defines values for OAuthTokenRequestGrantType.
type OAuthTokenRequestSubjectTokenType ¶ added in v0.47.0
type OAuthTokenRequestSubjectTokenType string
OAuthTokenRequestSubjectTokenType Token exchange only — the type of `subject_token`; only an access token is exchanged.
const (
UrnIetfParamsOauthTokenTypeAccessToken OAuthTokenRequestSubjectTokenType = "urn:ietf:params:oauth:token-type:access_token"
)
Defines values for OAuthTokenRequestSubjectTokenType.
type OAuthTokenResponse ¶
type OAuthTokenResponse struct {
AccessToken string `json:"access_token"`
// AccountId The account a service token or an exchanged token acts in.
AccountId *string `json:"account_id,omitempty"`
ClientId *string `json:"client_id,omitempty"`
// ExpireTime The moment the token expires, in milliseconds since the epoch (UTC).
ExpireTime *int64 `json:"expire_time,omitempty"`
// ExpiresIn Lifetime in seconds. Omitted for non-expiring tokens.
ExpiresIn *int64 `json:"expires_in,omitempty"`
// IssuedTokenType Token exchange only — `urn:ietf:params:oauth:token-type:access_token`.
IssuedTokenType *string `json:"issued_token_type,omitempty"`
// RefreshToken Present when a refresh token was issued (rotated on every refresh). Service tokens and exchanged tokens never carry one.
RefreshToken *string `json:"refresh_token,omitempty"`
Scope *string `json:"scope,omitempty"`
TokenType string `json:"token_type"`
}
OAuthTokenResponse defines model for OAuthTokenResponse.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type ResetOAuthApplicationSecretHTTPResp ¶ added in v0.47.0
type ResetOAuthApplicationSecretHTTPResp struct {
Body []byte
HTTPResponse *http.Response
JSON200 *OAuthApplicationSecret
JSON403 *OAuth2Error
JSON404 *OAuth2Error
}
func ParseResetOAuthApplicationSecretHTTPResp ¶ added in v0.47.0
func ParseResetOAuthApplicationSecretHTTPResp(rsp *http.Response) (*ResetOAuthApplicationSecretHTTPResp, error)
ParseResetOAuthApplicationSecretHTTPResp parses an HTTP response from a ResetOAuthApplicationSecretWithResponse call
func (ResetOAuthApplicationSecretHTTPResp) Status ¶ added in v0.47.0
func (r ResetOAuthApplicationSecretHTTPResp) Status() string
Status returns HTTPResponse.Status
func (ResetOAuthApplicationSecretHTTPResp) StatusCode ¶ added in v0.47.0
func (r ResetOAuthApplicationSecretHTTPResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RevokeFormdataRequestBody ¶
type RevokeFormdataRequestBody = OAuthRevokeRequest
RevokeFormdataRequestBody defines body for Revoke for application/x-www-form-urlencoded ContentType.
type RevokeHTTPResp ¶
type RevokeHTTPResp struct {
Body []byte
HTTPResponse *http.Response
JSON200 *map[string]interface{}
JSON400 *OAuth2Error
JSON401 *OAuth2Error
}
func ParseRevokeHTTPResp ¶
func ParseRevokeHTTPResp(rsp *http.Response) (*RevokeHTTPResp, error)
ParseRevokeHTTPResp parses an HTTP response from a RevokeWithResponse call
func (RevokeHTTPResp) Status ¶
func (r RevokeHTTPResp) Status() string
Status returns HTTPResponse.Status
func (RevokeHTTPResp) StatusCode ¶
func (r RevokeHTTPResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RevokeOAuthApplicationTokensHTTPResp ¶ added in v0.47.0
type RevokeOAuthApplicationTokensHTTPResp struct {
Body []byte
HTTPResponse *http.Response
JSON200 *map[string]interface{}
JSON403 *OAuth2Error
JSON404 *OAuth2Error
}
func ParseRevokeOAuthApplicationTokensHTTPResp ¶ added in v0.47.0
func ParseRevokeOAuthApplicationTokensHTTPResp(rsp *http.Response) (*RevokeOAuthApplicationTokensHTTPResp, error)
ParseRevokeOAuthApplicationTokensHTTPResp parses an HTTP response from a RevokeOAuthApplicationTokensWithResponse call
func (RevokeOAuthApplicationTokensHTTPResp) Status ¶ added in v0.47.0
func (r RevokeOAuthApplicationTokensHTTPResp) Status() string
Status returns HTTPResponse.Status
func (RevokeOAuthApplicationTokensHTTPResp) StatusCode ¶ added in v0.47.0
func (r RevokeOAuthApplicationTokensHTTPResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type TokenFormdataRequestBody ¶
type TokenFormdataRequestBody = OAuthTokenRequest
TokenFormdataRequestBody defines body for Token for application/x-www-form-urlencoded ContentType.
type TokenHTTPResp ¶
type TokenHTTPResp struct {
Body []byte
HTTPResponse *http.Response
JSON200 *OAuthTokenResponse
JSON400 *OAuth2Error
JSON401 *OAuth2Error
}
func ParseTokenHTTPResp ¶
func ParseTokenHTTPResp(rsp *http.Response) (*TokenHTTPResp, error)
ParseTokenHTTPResp parses an HTTP response from a TokenWithResponse call
func (TokenHTTPResp) Status ¶
func (r TokenHTTPResp) Status() string
Status returns HTTPResponse.Status
func (TokenHTTPResp) StatusCode ¶
func (r TokenHTTPResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type UpdateOAuthApplicationHTTPResp ¶ added in v0.47.0
type UpdateOAuthApplicationHTTPResp struct {
Body []byte
HTTPResponse *http.Response
JSON201 *map[string]interface{}
JSON400 *map[string]interface{}
JSON403 *OAuth2Error
JSON404 *OAuth2Error
}
func ParseUpdateOAuthApplicationHTTPResp ¶ added in v0.47.0
func ParseUpdateOAuthApplicationHTTPResp(rsp *http.Response) (*UpdateOAuthApplicationHTTPResp, error)
ParseUpdateOAuthApplicationHTTPResp parses an HTTP response from a UpdateOAuthApplicationWithResponse call
func (UpdateOAuthApplicationHTTPResp) Status ¶ added in v0.47.0
func (r UpdateOAuthApplicationHTTPResp) Status() string
Status returns HTTPResponse.Status
func (UpdateOAuthApplicationHTTPResp) StatusCode ¶ added in v0.47.0
func (r UpdateOAuthApplicationHTTPResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type UpdateOAuthApplicationJSONRequestBody ¶ added in v0.47.0
type UpdateOAuthApplicationJSONRequestBody = OAuthApplicationUpdateRequest
UpdateOAuthApplicationJSONRequestBody defines body for UpdateOAuthApplication for application/json ContentType.