Documentation
¶
Overview ¶
Package admin provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
Index ¶
- func NewCreateRealmRequest(server string, body CreateRealmJSONRequestBody) (*http.Request, error)
- func NewCreateRealmRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewDeleteRealmRequest(server string, realm string) (*http.Request, error)
- func NewGetRealmRequest(server string, realm string) (*http.Request, error)
- func NewListRealmsRequest(server string, params *ListRealmsParams) (*http.Request, error)
- func NewPatchRealmRequest(server string, realm string, body PatchRealmJSONRequestBody) (*http.Request, error)
- func NewPatchRealmRequestWithBody(server string, realm string, contentType string, body io.Reader) (*http.Request, error)
- func NewUpdateRealmRequest(server string, realm string, body UpdateRealmJSONRequestBody) (*http.Request, error)
- func NewUpdateRealmRequestWithBody(server string, realm string, contentType string, body io.Reader) (*http.Request, error)
- type APIError
- type Client
- func (c *Client) CreateRealm(ctx context.Context, body CreateRealmJSONRequestBody, ...) (*RealmResponse, error)
- func (c *Client) CreateRealmWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*RealmResponse, error)
- func (c *Client) DeleteRealm(ctx context.Context, realm string, reqEditors ...RequestEditorFn) (*Response, error)
- func (c *Client) GetRealm(ctx context.Context, realm string, reqEditors ...RequestEditorFn) (*RealmResponse, error)
- func (c *Client) ListRealms(ctx context.Context, params *ListRealmsParams, reqEditors ...RequestEditorFn) (*RealmCollection, error)
- func (c *Client) PatchRealm(ctx context.Context, realm string, body PatchRealmJSONRequestBody, ...) (*RealmResponse, error)
- func (c *Client) PatchRealmWithBody(ctx context.Context, realm string, contentType string, body io.Reader, ...) (*RealmResponse, error)
- func (c *Client) UpdateRealm(ctx context.Context, realm string, body UpdateRealmJSONRequestBody, ...) (*RealmResponse, error)
- func (c *Client) UpdateRealmWithBody(ctx context.Context, realm string, contentType string, body io.Reader, ...) (*RealmResponse, error)
- type ClientInterface
- type ClientOption
- type CreateRealm401JSONResponseBodyError
- type CreateRealm403JSONResponseBodyError
- type CreateRealmData
- type CreateRealmJSONRequestBody
- type DeleteRealm401JSONResponseBodyError
- type DeleteRealm403JSONResponseBodyError
- type GetRealm401JSONResponseBodyError
- type GetRealm403JSONResponseBodyError
- type HttpRequestDoer
- type ListRealms401JSONResponseBodyError
- type ListRealms403JSONResponseBodyError
- type ListRealmsParams
- type ListRealmsParamsFilterDomainStatus
- type ListRealmsParamsSort
- type ModelNotFoundException
- type PatchRealm401JSONResponseBodyError
- type PatchRealm403JSONResponseBodyError
- type PatchRealmJSONRequestBody
- type RealmCollection
- type RealmData
- type RealmDomainStatus
- type RealmResponse
- type RealmSettings
- type RealmSettingsPatch
- type RequestEditorFn
- type Response
- type UpdateRealm401JSONResponseBodyError
- type UpdateRealm403JSONResponseBodyError
- type UpdateRealmData
- type UpdateRealmJSONRequestBody
- type ValidationException
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCreateRealmRequest ¶
func NewCreateRealmRequest(server string, body CreateRealmJSONRequestBody) (*http.Request, error)
NewCreateRealmRequest calls the generic CreateRealm builder with application/json body
func NewCreateRealmRequestWithBody ¶
func NewCreateRealmRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewCreateRealmRequestWithBody constructs an http.Request for the CreateRealm method, with any body, and a specified content type
func NewDeleteRealmRequest ¶
NewDeleteRealmRequest constructs an http.Request for the DeleteRealm method
func NewGetRealmRequest ¶
NewGetRealmRequest constructs an http.Request for the GetRealm method
func NewListRealmsRequest ¶
func NewListRealmsRequest(server string, params *ListRealmsParams) (*http.Request, error)
NewListRealmsRequest constructs an http.Request for the ListRealms method
func NewPatchRealmRequest ¶
func NewPatchRealmRequest(server string, realm string, body PatchRealmJSONRequestBody) (*http.Request, error)
NewPatchRealmRequest calls the generic PatchRealm builder with application/json body
func NewPatchRealmRequestWithBody ¶
func NewPatchRealmRequestWithBody(server string, realm string, contentType string, body io.Reader) (*http.Request, error)
NewPatchRealmRequestWithBody constructs an http.Request for the PatchRealm method, with any body, and a specified content type
func NewUpdateRealmRequest ¶
func NewUpdateRealmRequest(server string, realm string, body UpdateRealmJSONRequestBody) (*http.Request, error)
NewUpdateRealmRequest calls the generic UpdateRealm builder with application/json body
Types ¶
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
Example ¶
package main
import (
"context"
"log"
"net/http"
"time"
"github.com/use-lock/client-go/admin"
)
func main() {
client, err := admin.NewClient("https://lock.example/api",
admin.WithHTTPClient(&http.Client{Timeout: 30 * time.Second}),
admin.WithToken("<access-token>"),
)
if err != nil {
log.Fatal(err)
}
response, err := client.GetRealm(context.Background(), "staging")
if err != nil {
log.Fatal(err)
}
log.Print(response.Data.Name)
}
Output:
func (*Client) CreateRealm ¶
func (c *Client) CreateRealm(ctx context.Context, body CreateRealmJSONRequestBody, reqEditors ...RequestEditorFn) (*RealmResponse, error)
CreateRealm Create a realm
The realm gets its own signing keypair, and its domain is checked right away. A domain that does not reach this instance yet is reported through `domain_status` rather than refused — DNS and the proxy usually follow. Settings left out of `settings` follow the instance defaults.
Takes a body of the `application/json` content type.
Corresponds with POST /v1/realms (the `CreateRealm` operationId).
func (*Client) CreateRealmWithBody ¶
func (c *Client) CreateRealmWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RealmResponse, error)
CreateRealmWithBody Create a realm
The realm gets its own signing keypair, and its domain is checked right away. A domain that does not reach this instance yet is reported through `domain_status` rather than refused — DNS and the proxy usually follow. Settings left out of `settings` follow the instance defaults.
Takes any type of body and a specified content type.
Corresponds with POST /v1/realms (the `CreateRealm` operationId).
func (*Client) DeleteRealm ¶
func (c *Client) DeleteRealm(ctx context.Context, realm string, reqEditors ...RequestEditorFn) (*Response, error)
DeleteRealm Delete a realm
Purges the realm's users, roles, clients, tokens and keys, and frees its slug. The administration realm cannot be deleted.
Corresponds with DELETE /v1/realms/{realm} (the `DeleteRealm` operationId).
func (*Client) GetRealm ¶
func (c *Client) GetRealm(ctx context.Context, realm string, reqEditors ...RequestEditorFn) (*RealmResponse, error)
GetRealm Show a realm
Corresponds with GET /v1/realms/{realm} (the `GetRealm` operationId).
func (*Client) ListRealms ¶
func (c *Client) ListRealms(ctx context.Context, params *ListRealmsParams, reqEditors ...RequestEditorFn) (*RealmCollection, error)
ListRealms List realms
Every realm this instance serves, the administration realm included.
Corresponds with GET /v1/realms (the `ListRealms` operationId).
func (*Client) PatchRealm ¶
func (c *Client) PatchRealm(ctx context.Context, realm string, body PatchRealmJSONRequestBody, reqEditors ...RequestEditorFn) (*RealmResponse, error)
PatchRealm Update a realm
A realm's slug is immutable. Settings left out of `settings` keep their current value. Re-pointing the domain changes the issuer of every token the realm mints and restarts the domain check.
Takes a body of the `application/json` content type.
Corresponds with PATCH /v1/realms/{realm} (the `PatchRealm` operationId).
func (*Client) PatchRealmWithBody ¶
func (c *Client) PatchRealmWithBody(ctx context.Context, realm string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RealmResponse, error)
PatchRealmWithBody Update a realm
A realm's slug is immutable. Settings left out of `settings` keep their current value. Re-pointing the domain changes the issuer of every token the realm mints and restarts the domain check.
Takes any type of body and a specified content type.
Corresponds with PATCH /v1/realms/{realm} (the `PatchRealm` operationId).
func (*Client) UpdateRealm ¶
func (c *Client) UpdateRealm(ctx context.Context, realm string, body UpdateRealmJSONRequestBody, reqEditors ...RequestEditorFn) (*RealmResponse, error)
UpdateRealm Update a realm
A realm's slug is immutable. Settings left out of `settings` keep their current value. Re-pointing the domain changes the issuer of every token the realm mints and restarts the domain check.
Takes a body of the `application/json` content type.
Corresponds with PUT /v1/realms/{realm} (the `UpdateRealm` operationId).
func (*Client) UpdateRealmWithBody ¶
func (c *Client) UpdateRealmWithBody(ctx context.Context, realm string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RealmResponse, error)
UpdateRealmWithBody Update a realm
A realm's slug is immutable. Settings left out of `settings` keep their current value. Re-pointing the domain changes the issuer of every token the realm mints and restarts the domain check.
Takes any type of body and a specified content type.
Corresponds with PUT /v1/realms/{realm} (the `UpdateRealm` operationId).
type ClientInterface ¶
type ClientInterface interface {
// ListRealms List realms
//
// Every realm this instance serves, the administration realm included.
//
// Corresponds with GET /v1/realms (the `ListRealms` operationId).
ListRealms(ctx context.Context, params *ListRealmsParams, reqEditors ...RequestEditorFn) (*RealmCollection, error)
// CreateRealmWithBody Create a realm
//
// The realm gets its own signing keypair, and its domain is checked right
// away. A domain that does not reach this instance yet is reported through
// `domain_status` rather than refused — DNS and the proxy usually follow.
// Settings left out of `settings` follow the instance defaults.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /v1/realms (the `CreateRealm` operationId).
CreateRealmWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RealmResponse, error)
// CreateRealm Create a realm
//
// The realm gets its own signing keypair, and its domain is checked right
// away. A domain that does not reach this instance yet is reported through
// `domain_status` rather than refused — DNS and the proxy usually follow.
// Settings left out of `settings` follow the instance defaults.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /v1/realms (the `CreateRealm` operationId).
CreateRealm(ctx context.Context, body CreateRealmJSONRequestBody, reqEditors ...RequestEditorFn) (*RealmResponse, error)
// DeleteRealm Delete a realm
//
// Purges the realm's users, roles, clients, tokens and keys, and frees its
// slug. The administration realm cannot be deleted.
//
// Corresponds with DELETE /v1/realms/{realm} (the `DeleteRealm` operationId).
DeleteRealm(ctx context.Context, realm string, reqEditors ...RequestEditorFn) (*Response, error)
// GetRealm Show a realm
//
// Corresponds with GET /v1/realms/{realm} (the `GetRealm` operationId).
GetRealm(ctx context.Context, realm string, reqEditors ...RequestEditorFn) (*RealmResponse, error)
// PatchRealmWithBody Update a realm
//
// A realm's slug is immutable. Settings left out of `settings` keep
// their current value. Re-pointing the domain changes the issuer of every
// token the realm mints and restarts the domain check.
//
// Takes any type of body and a specified content type.
//
// Corresponds with PATCH /v1/realms/{realm} (the `PatchRealm` operationId).
PatchRealmWithBody(ctx context.Context, realm string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RealmResponse, error)
// PatchRealm Update a realm
//
// A realm's slug is immutable. Settings left out of `settings` keep
// their current value. Re-pointing the domain changes the issuer of every
// token the realm mints and restarts the domain check.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with PATCH /v1/realms/{realm} (the `PatchRealm` operationId).
PatchRealm(ctx context.Context, realm string, body PatchRealmJSONRequestBody, reqEditors ...RequestEditorFn) (*RealmResponse, error)
// UpdateRealmWithBody Update a realm
//
// A realm's slug is immutable. Settings left out of `settings` keep
// their current value. Re-pointing the domain changes the issuer of every
// token the realm mints and restarts the domain check.
//
// Takes any type of body and a specified content type.
//
// Corresponds with PUT /v1/realms/{realm} (the `UpdateRealm` operationId).
UpdateRealmWithBody(ctx context.Context, realm string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RealmResponse, error)
// UpdateRealm Update a realm
//
// A realm's slug is immutable. Settings left out of `settings` keep
// their current value. Re-pointing the domain changes the issuer of every
// token the realm mints and restarts the domain check.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with PUT /v1/realms/{realm} (the `UpdateRealm` operationId).
UpdateRealm(ctx context.Context, realm string, body UpdateRealmJSONRequestBody, reqEditors ...RequestEditorFn) (*RealmResponse, 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.
func WithToken ¶
func WithToken(token string) ClientOption
type CreateRealm401JSONResponseBodyError ¶
type CreateRealm401JSONResponseBodyError string
CreateRealm401JSONResponseBodyError defines parameters for CreateRealm.
const (
CreateRealm401JSONResponseBodyErrorInvalidToken CreateRealm401JSONResponseBodyError = "invalid_token"
)
Defines values for CreateRealm401JSONResponseBodyError.
func (CreateRealm401JSONResponseBodyError) Valid ¶
func (e CreateRealm401JSONResponseBodyError) Valid() bool
Valid indicates whether the value is a known member of the CreateRealm401JSONResponseBodyError enum.
type CreateRealm403JSONResponseBodyError ¶
type CreateRealm403JSONResponseBodyError string
CreateRealm403JSONResponseBodyError defines parameters for CreateRealm.
const (
CreateRealm403JSONResponseBodyErrorInsufficientScope CreateRealm403JSONResponseBodyError = "insufficient_scope"
)
Defines values for CreateRealm403JSONResponseBodyError.
func (CreateRealm403JSONResponseBodyError) Valid ¶
func (e CreateRealm403JSONResponseBodyError) Valid() bool
Valid indicates whether the value is a known member of the CreateRealm403JSONResponseBodyError enum.
type CreateRealmData ¶
type CreateRealmData struct {
// Domain The domain the realm is served from. Lock checks that it reaches this instance, but keeps the realm either way.
Domain string `json:"domain"`
// Name Human readable name shown to the realm’s users.
Name string `json:"name"`
// Settings The realm’s policy. Settings left out follow the instance defaults.
Settings *RealmSettingsPatch `json:"settings,omitempty"`
// Slug Stable identifier, lowercase and dash separated. It cannot be changed later.
Slug string `json:"slug"`
}
CreateRealmData defines model for CreateRealmData.
type CreateRealmJSONRequestBody ¶
type CreateRealmJSONRequestBody = CreateRealmData
CreateRealmJSONRequestBody defines body for CreateRealm for application/json ContentType.
type DeleteRealm401JSONResponseBodyError ¶
type DeleteRealm401JSONResponseBodyError string
DeleteRealm401JSONResponseBodyError defines parameters for DeleteRealm.
const (
DeleteRealm401JSONResponseBodyErrorInvalidToken DeleteRealm401JSONResponseBodyError = "invalid_token"
)
Defines values for DeleteRealm401JSONResponseBodyError.
func (DeleteRealm401JSONResponseBodyError) Valid ¶
func (e DeleteRealm401JSONResponseBodyError) Valid() bool
Valid indicates whether the value is a known member of the DeleteRealm401JSONResponseBodyError enum.
type DeleteRealm403JSONResponseBodyError ¶
type DeleteRealm403JSONResponseBodyError string
DeleteRealm403JSONResponseBodyError defines parameters for DeleteRealm.
const (
DeleteRealm403JSONResponseBodyErrorInsufficientScope DeleteRealm403JSONResponseBodyError = "insufficient_scope"
)
Defines values for DeleteRealm403JSONResponseBodyError.
func (DeleteRealm403JSONResponseBodyError) Valid ¶
func (e DeleteRealm403JSONResponseBodyError) Valid() bool
Valid indicates whether the value is a known member of the DeleteRealm403JSONResponseBodyError enum.
type GetRealm401JSONResponseBodyError ¶
type GetRealm401JSONResponseBodyError string
GetRealm401JSONResponseBodyError defines parameters for GetRealm.
const (
GetRealm401JSONResponseBodyErrorInvalidToken GetRealm401JSONResponseBodyError = "invalid_token"
)
Defines values for GetRealm401JSONResponseBodyError.
func (GetRealm401JSONResponseBodyError) Valid ¶
func (e GetRealm401JSONResponseBodyError) Valid() bool
Valid indicates whether the value is a known member of the GetRealm401JSONResponseBodyError enum.
type GetRealm403JSONResponseBodyError ¶
type GetRealm403JSONResponseBodyError string
GetRealm403JSONResponseBodyError defines parameters for GetRealm.
const (
GetRealm403JSONResponseBodyErrorInsufficientScope GetRealm403JSONResponseBodyError = "insufficient_scope"
)
Defines values for GetRealm403JSONResponseBodyError.
func (GetRealm403JSONResponseBodyError) Valid ¶
func (e GetRealm403JSONResponseBodyError) Valid() bool
Valid indicates whether the value is a known member of the GetRealm403JSONResponseBodyError enum.
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type ListRealms401JSONResponseBodyError ¶
type ListRealms401JSONResponseBodyError string
ListRealms401JSONResponseBodyError defines parameters for ListRealms.
const (
ListRealms401JSONResponseBodyErrorInvalidToken ListRealms401JSONResponseBodyError = "invalid_token"
)
Defines values for ListRealms401JSONResponseBodyError.
func (ListRealms401JSONResponseBodyError) Valid ¶
func (e ListRealms401JSONResponseBodyError) Valid() bool
Valid indicates whether the value is a known member of the ListRealms401JSONResponseBodyError enum.
type ListRealms403JSONResponseBodyError ¶
type ListRealms403JSONResponseBodyError string
ListRealms403JSONResponseBodyError defines parameters for ListRealms.
const (
ListRealms403JSONResponseBodyErrorInsufficientScope ListRealms403JSONResponseBodyError = "insufficient_scope"
)
Defines values for ListRealms403JSONResponseBodyError.
func (ListRealms403JSONResponseBodyError) Valid ¶
func (e ListRealms403JSONResponseBodyError) Valid() bool
Valid indicates whether the value is a known member of the ListRealms403JSONResponseBodyError enum.
type ListRealmsParams ¶
type ListRealmsParams struct {
// Sort Available sorts are `name`, `slug`, `created_at`. You can sort by multiple options by separating them with a comma. To sort in descending order, use `-` sign in front of the sort, for example: `-name`.
Sort *[]ListRealmsParamsSort `form:"sort,omitempty" json:"sort,omitempty"`
// FilterName Filter by `name`. Matches values containing the given text, case-insensitively. Separate multiple values with a comma; records matching any value qualify.
FilterName *[]string `form:"filter[name],omitempty" json:"filter[name],omitempty"`
// FilterSlug Filter by `slug`. Matches the exact value. Separate multiple values with a comma; records matching any value qualify.
FilterSlug *[]string `form:"filter[slug],omitempty" json:"filter[slug],omitempty"`
// FilterDomain Filter by `domain`. Matches the exact value. Separate multiple values with a comma; records matching any value qualify.
FilterDomain *[]string `form:"filter[domain],omitempty" json:"filter[domain],omitempty"`
// FilterDomainStatus Filter by `domain_status`. Matches the exact value. Separate multiple values with a comma; records matching any value qualify.
FilterDomainStatus *[]ListRealmsParamsFilterDomainStatus `form:"filter[domain_status],omitempty" json:"filter[domain_status],omitempty"`
// Page The page number to retrieve.
Page *int `form:"page,omitempty" json:"page,omitempty"`
// PerPage The number of items to retrieve per page.
PerPage *int `form:"per_page,omitempty" json:"per_page,omitempty"`
}
ListRealmsParams defines parameters for ListRealms.
type ListRealmsParamsFilterDomainStatus ¶
type ListRealmsParamsFilterDomainStatus string
ListRealmsParamsFilterDomainStatus defines parameters for ListRealms.
const ( ListRealmsParamsFilterDomainStatusMisrouted ListRealmsParamsFilterDomainStatus = "misrouted" ListRealmsParamsFilterDomainStatusPending ListRealmsParamsFilterDomainStatus = "pending" ListRealmsParamsFilterDomainStatusUnreachable ListRealmsParamsFilterDomainStatus = "unreachable" ListRealmsParamsFilterDomainStatusVerified ListRealmsParamsFilterDomainStatus = "verified" )
Defines values for ListRealmsParamsFilterDomainStatus.
func (ListRealmsParamsFilterDomainStatus) Valid ¶
func (e ListRealmsParamsFilterDomainStatus) Valid() bool
Valid indicates whether the value is a known member of the ListRealmsParamsFilterDomainStatus enum.
type ListRealmsParamsSort ¶
type ListRealmsParamsSort string
ListRealmsParamsSort defines parameters for ListRealms.
const ( CreatedAt ListRealmsParamsSort = "created_at" MinusCreatedAt ListRealmsParamsSort = "-created_at" MinusName ListRealmsParamsSort = "-name" MinusSlug ListRealmsParamsSort = "-slug" Name ListRealmsParamsSort = "name" Slug ListRealmsParamsSort = "slug" )
Defines values for ListRealmsParamsSort.
func (ListRealmsParamsSort) Valid ¶
func (e ListRealmsParamsSort) Valid() bool
Valid indicates whether the value is a known member of the ListRealmsParamsSort enum.
type ModelNotFoundException ¶
type ModelNotFoundException struct {
// Message Error overview.
Message string `json:"message"`
}
ModelNotFoundException defines model for ModelNotFoundException.
type PatchRealm401JSONResponseBodyError ¶
type PatchRealm401JSONResponseBodyError string
PatchRealm401JSONResponseBodyError defines parameters for PatchRealm.
const (
PatchRealm401JSONResponseBodyErrorInvalidToken PatchRealm401JSONResponseBodyError = "invalid_token"
)
Defines values for PatchRealm401JSONResponseBodyError.
func (PatchRealm401JSONResponseBodyError) Valid ¶
func (e PatchRealm401JSONResponseBodyError) Valid() bool
Valid indicates whether the value is a known member of the PatchRealm401JSONResponseBodyError enum.
type PatchRealm403JSONResponseBodyError ¶
type PatchRealm403JSONResponseBodyError string
PatchRealm403JSONResponseBodyError defines parameters for PatchRealm.
const (
PatchRealm403JSONResponseBodyErrorInsufficientScope PatchRealm403JSONResponseBodyError = "insufficient_scope"
)
Defines values for PatchRealm403JSONResponseBodyError.
func (PatchRealm403JSONResponseBodyError) Valid ¶
func (e PatchRealm403JSONResponseBodyError) Valid() bool
Valid indicates whether the value is a known member of the PatchRealm403JSONResponseBodyError enum.
type PatchRealmJSONRequestBody ¶
type PatchRealmJSONRequestBody = UpdateRealmData
PatchRealmJSONRequestBody defines body for PatchRealm for application/json ContentType.
type RealmCollection ¶
type RealmCollection struct {
Data []RealmData `json:"data"`
Links []struct {
Active bool `json:"active"`
Label string `json:"label"`
URL nullable.Nullable[string] `json:"url"`
} `json:"links"`
Meta struct {
CurrentPage int `json:"current_page"`
FirstPageURL nullable.Nullable[string] `json:"first_page_url"`
From nullable.Nullable[int] `json:"from"`
LastPage int `json:"last_page"`
LastPageURL nullable.Nullable[string] `json:"last_page_url"`
NextPageURL nullable.Nullable[string] `json:"next_page_url"`
Path nullable.Nullable[string] `json:"path"`
PerPage int `json:"per_page"`
PrevPageURL nullable.Nullable[string] `json:"prev_page_url"`
To nullable.Nullable[int] `json:"to"`
Total int `json:"total"`
} `json:"meta"`
}
RealmCollection defines model for RealmCollection.
type RealmData ¶
type RealmData struct {
// CreatedAt When the realm was created.
CreatedAt nullable.Nullable[string] `json:"created_at,omitempty"`
// Domain The configured domain; null for the master realm, which follows APP_URL.
Domain nullable.Nullable[string] `json:"domain,omitempty"`
// DomainCheckError Why the last domain check failed, when it did.
DomainCheckError nullable.Nullable[string] `json:"domain_check_error,omitempty"`
// DomainCheckedAt When the domain was last checked.
DomainCheckedAt nullable.Nullable[string] `json:"domain_checked_at,omitempty"`
// DomainStatus Whether the configured domain was seen to reach this instance.
DomainStatus RealmDomainStatus `json:"domain_status"`
// Host The host the realm is served from.
Host string `json:"host"`
// Issuer The realm’s OIDC issuer, the `iss` of every token it mints.
Issuer string `json:"issuer"`
// Master Whether this is the administration realm, which cannot be deleted or re-pointed.
Master bool `json:"master"`
// Name Human readable name shown to its users.
Name string `json:"name"`
// Settings The realm’s own policy.
Settings RealmSettings `json:"settings"`
// Slug Stable identifier of the realm, and its path in this API.
Slug string `json:"slug"`
// UpdatedAt When the realm was last changed.
UpdatedAt nullable.Nullable[string] `json:"updated_at,omitempty"`
}
RealmData defines model for RealmData.
type RealmDomainStatus ¶
type RealmDomainStatus string
RealmDomainStatus What the last domain check found. `Unreachable` means no HTTP answer at all (DNS, connection, TLS); `Misrouted` means something answered, but not this Lock instance.
const ( RealmDomainStatusMisrouted RealmDomainStatus = "misrouted" RealmDomainStatusPending RealmDomainStatus = "pending" RealmDomainStatusUnreachable RealmDomainStatus = "unreachable" RealmDomainStatusVerified RealmDomainStatus = "verified" )
Defines values for RealmDomainStatus.
func (RealmDomainStatus) Valid ¶
func (e RealmDomainStatus) Valid() bool
Valid indicates whether the value is a known member of the RealmDomainStatus enum.
type RealmResponse ¶
type RealmResponse struct {
Data RealmData `json:"data"`
}
RealmResponse defines model for RealmResponse.
type RealmSettings ¶
type RealmSettings struct {
// AccessTokenLifetime Seconds an access token stays valid.
AccessTokenLifetime float32 `json:"access_token_lifetime"`
// AllowedRedirectDomains Hosts a redirect URI may point at; `*` allows any.
AllowedRedirectDomains []string `json:"allowed_redirect_domains"`
// AllowedRedirectSchemes URI schemes a redirect URI may use.
AllowedRedirectSchemes []string `json:"allowed_redirect_schemes"`
// AutoProvision Create a realm user on their first verified upstream sign-in.
AutoProvision bool `json:"auto_provision"`
// ChallengeProviders The second factors on offer: `totp`, `webauthn`.
ChallengeProviders []string `json:"challenge_providers"`
// ClientCredentialsLifetime Seconds a token issued to a machine client stays valid.
ClientCredentialsLifetime float32 `json:"client_credentials_lifetime"`
// DefaultScopes Scopes every client is granted without asking.
DefaultScopes []string `json:"default_scopes"`
// DynamicRegistration Whether a client may register itself through RFC 7591.
DynamicRegistration bool `json:"dynamic_registration"`
// EmailVerificationRequired Whether an unverified address blocks sign-in.
EmailVerificationRequired bool `json:"email_verification_required"`
// FirstPartyTrusted Whether the first-party client skips the consent screen.
FirstPartyTrusted bool `json:"first_party_trusted"`
// IDTokenLifetime Seconds an ID token stays valid.
IDTokenLifetime float32 `json:"id_token_lifetime"`
// LinkByVerifiedEmail Link an upstream identity to a local user with the same verified email address.
LinkByVerifiedEmail bool `json:"link_by_verified_email"`
// LoginMethods The ways an identity may sign in: `password`, `passkey`, `social`.
LoginMethods []string `json:"login_methods"`
// MfaRequirement When a second factor is demanded: `never`, `if_enrolled`, `always`.
MfaRequirement string `json:"mfa_requirement"`
// OptionalScopes Scopes a client may request on top; `*` allows any of the catalog.
OptionalScopes []string `json:"optional_scopes"`
// PasswordHistory How many previous passwords may not be reused.
PasswordHistory float32 `json:"password_history"`
// PasswordMaxAgeDays Days before a password must be changed; `0` never expires.
PasswordMaxAgeDays float32 `json:"password_max_age_days"`
// PasswordMinLength Shortest password accepted.
PasswordMinLength float32 `json:"password_min_length"`
// PasswordMixedCase Whether a password must mix upper and lower case.
PasswordMixedCase bool `json:"password_mixed_case"`
// PasswordNumbers Whether a password must carry a digit.
PasswordNumbers bool `json:"password_numbers"`
// PasswordSymbols Whether a password must carry a symbol.
PasswordSymbols bool `json:"password_symbols"`
// PasswordUncompromised Whether a password is checked against known breaches.
PasswordUncompromised bool `json:"password_uncompromised"`
// RecoveryCodes How many recovery codes an identity is issued.
RecoveryCodes float32 `json:"recovery_codes"`
// RefreshTokenLifetime Seconds a refresh token stays valid.
RefreshTokenLifetime float32 `json:"refresh_token_lifetime"`
// SessionAbsoluteLifetime Seconds a sign-in session lives at most, however often it is refreshed.
SessionAbsoluteLifetime float32 `json:"session_absolute_lifetime"`
// SessionTokenRefreshSkew Seconds before expiry at which a session token is refreshed early.
SessionTokenRefreshSkew float32 `json:"session_token_refresh_skew"`
// SessionTokenTTL Seconds a session token stays valid before it is refreshed.
SessionTokenTTL float32 `json:"session_token_ttl"`
// TokenExchange Whether the RFC 8693 token exchange grant is served.
TokenExchange bool `json:"token_exchange"`
// TotpSecretLength Bytes of a generated TOTP secret.
TotpSecretLength float32 `json:"totp_secret_length"`
// TotpWindow Time steps either side of now a TOTP code is accepted in.
TotpWindow float32 `json:"totp_window"`
// TrustedClients Client ids that skip the consent screen.
TrustedClients []string `json:"trusted_clients"`
}
RealmSettings defines model for RealmSettings.
type RealmSettingsPatch ¶
type RealmSettingsPatch struct {
// AccessTokenLifetime Seconds an access token stays valid.
AccessTokenLifetime *float32 `json:"access_token_lifetime,omitempty"`
// AllowedRedirectDomains Hosts a redirect URI may point at; `*` allows any.
AllowedRedirectDomains *[]string `json:"allowed_redirect_domains,omitempty"`
// AllowedRedirectSchemes URI schemes a redirect URI may use.
AllowedRedirectSchemes *[]string `json:"allowed_redirect_schemes,omitempty"`
// AutoProvision Create a realm user on their first verified upstream sign-in.
AutoProvision *bool `json:"auto_provision,omitempty"`
// ChallengeProviders The second factors on offer: `totp`, `webauthn`.
ChallengeProviders *[]string `json:"challenge_providers,omitempty"`
// ClientCredentialsLifetime Seconds a token issued to a machine client stays valid.
ClientCredentialsLifetime *float32 `json:"client_credentials_lifetime,omitempty"`
// DefaultScopes Scopes every client is granted without asking.
DefaultScopes *[]string `json:"default_scopes,omitempty"`
// DynamicRegistration Whether a client may register itself through RFC 7591.
DynamicRegistration *bool `json:"dynamic_registration,omitempty"`
// EmailVerificationRequired Whether an unverified address blocks sign-in.
EmailVerificationRequired *bool `json:"email_verification_required,omitempty"`
// FirstPartyTrusted Whether the first-party client skips the consent screen.
FirstPartyTrusted *bool `json:"first_party_trusted,omitempty"`
// IDTokenLifetime Seconds an ID token stays valid.
IDTokenLifetime *float32 `json:"id_token_lifetime,omitempty"`
// LinkByVerifiedEmail Link an upstream identity to a local user with the same verified email address.
LinkByVerifiedEmail *bool `json:"link_by_verified_email,omitempty"`
// LoginMethods The ways an identity may sign in: `password`, `passkey`, `social`.
LoginMethods *[]string `json:"login_methods,omitempty"`
// MfaRequirement When a second factor is demanded: `never`, `if_enrolled`, `always`.
MfaRequirement *string `json:"mfa_requirement,omitempty"`
// OptionalScopes Scopes a client may request on top; `*` allows any of the catalog.
OptionalScopes *[]string `json:"optional_scopes,omitempty"`
// PasswordHistory How many previous passwords may not be reused.
PasswordHistory *float32 `json:"password_history,omitempty"`
// PasswordMaxAgeDays Days before a password must be changed; `0` never expires.
PasswordMaxAgeDays *float32 `json:"password_max_age_days,omitempty"`
// PasswordMinLength Shortest password accepted.
PasswordMinLength *float32 `json:"password_min_length,omitempty"`
// PasswordMixedCase Whether a password must mix upper and lower case.
PasswordMixedCase *bool `json:"password_mixed_case,omitempty"`
// PasswordNumbers Whether a password must carry a digit.
PasswordNumbers *bool `json:"password_numbers,omitempty"`
// PasswordSymbols Whether a password must carry a symbol.
PasswordSymbols *bool `json:"password_symbols,omitempty"`
// PasswordUncompromised Whether a password is checked against known breaches.
PasswordUncompromised *bool `json:"password_uncompromised,omitempty"`
// RecoveryCodes How many recovery codes an identity is issued.
RecoveryCodes *float32 `json:"recovery_codes,omitempty"`
// RefreshTokenLifetime Seconds a refresh token stays valid.
RefreshTokenLifetime *float32 `json:"refresh_token_lifetime,omitempty"`
// SessionAbsoluteLifetime Seconds a sign-in session lives at most, however often it is refreshed.
SessionAbsoluteLifetime *float32 `json:"session_absolute_lifetime,omitempty"`
// SessionTokenRefreshSkew Seconds before expiry at which a session token is refreshed early.
SessionTokenRefreshSkew *float32 `json:"session_token_refresh_skew,omitempty"`
// SessionTokenTTL Seconds a session token stays valid before it is refreshed.
SessionTokenTTL *float32 `json:"session_token_ttl,omitempty"`
// TokenExchange Whether the RFC 8693 token exchange grant is served.
TokenExchange *bool `json:"token_exchange,omitempty"`
// TotpSecretLength Bytes of a generated TOTP secret.
TotpSecretLength *float32 `json:"totp_secret_length,omitempty"`
// TotpWindow Time steps either side of now a TOTP code is accepted in.
TotpWindow *float32 `json:"totp_window,omitempty"`
// TrustedClients Client ids that skip the consent screen.
TrustedClients *[]string `json:"trusted_clients,omitempty"`
}
RealmSettingsPatch defines model for RealmSettingsPatch.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type UpdateRealm401JSONResponseBodyError ¶
type UpdateRealm401JSONResponseBodyError string
UpdateRealm401JSONResponseBodyError defines parameters for UpdateRealm.
const (
UpdateRealm401JSONResponseBodyErrorInvalidToken UpdateRealm401JSONResponseBodyError = "invalid_token"
)
Defines values for UpdateRealm401JSONResponseBodyError.
func (UpdateRealm401JSONResponseBodyError) Valid ¶
func (e UpdateRealm401JSONResponseBodyError) Valid() bool
Valid indicates whether the value is a known member of the UpdateRealm401JSONResponseBodyError enum.
type UpdateRealm403JSONResponseBodyError ¶
type UpdateRealm403JSONResponseBodyError string
UpdateRealm403JSONResponseBodyError defines parameters for UpdateRealm.
const (
UpdateRealm403JSONResponseBodyErrorInsufficientScope UpdateRealm403JSONResponseBodyError = "insufficient_scope"
)
Defines values for UpdateRealm403JSONResponseBodyError.
func (UpdateRealm403JSONResponseBodyError) Valid ¶
func (e UpdateRealm403JSONResponseBodyError) Valid() bool
Valid indicates whether the value is a known member of the UpdateRealm403JSONResponseBodyError enum.
type UpdateRealmData ¶
type UpdateRealmData struct {
// Domain The domain the realm is served from. Re-pointing it changes the issuer and restarts the domain check.
Domain *string `json:"domain,omitempty"`
// Name Human readable name shown to the realm’s users.
Name *string `json:"name,omitempty"`
// Settings Any subset of the realm’s policy; settings left out keep their current value.
Settings *RealmSettingsPatch `json:"settings,omitempty"`
}
UpdateRealmData defines model for UpdateRealmData.
type UpdateRealmJSONRequestBody ¶
type UpdateRealmJSONRequestBody = UpdateRealmData
UpdateRealmJSONRequestBody defines body for UpdateRealm for application/json ContentType.
type ValidationException ¶
type ValidationException struct {
// Errors A detailed description of each field that failed validation.
Errors map[string][]string `json:"errors"`
// Message Errors overview.
Message string `json:"message"`
}
ValidationException defines model for ValidationException.