Documentation ¶
Index ¶
- type APIClient
- func (c *APIClient) CallAPI(path string, method string, postBody interface{}, ...) (*resty.Response, error)
- func (c *APIClient) ParameterToString(obj interface{}, collectionFormat string) string
- func (c *APIClient) SelectHeaderAccept(accepts []string) string
- func (c *APIClient) SelectHeaderContentType(contentTypes []string) string
- type APIResponse
- type AuthenticationDefaultSession
- type AuthenticationOAuth2ClientCredentialsRequest
- type AuthenticationOAuth2ClientCredentialsSession
- type AuthenticationOAuth2IntrospectionRequest
- type AuthenticationOAuth2Session
- type Authenticator
- type Configuration
- type Firewall
- type Handler
- type HealthApi
- type HealthNotReadyStatus
- type HealthStatus
- type InlineResponse500
- type IntrospectionResponse
- type Manager
- type OAuth2ClientCredentialsAuthentication
- type OAuth2IntrospectionAuthentication
- type Policy
- type PolicyApi
- func (a PolicyApi) CreatePolicy(body Policy) (*Policy, *APIResponse, error)
- func (a PolicyApi) DeletePolicy(id string) (*APIResponse, error)
- func (a PolicyApi) GetPolicy(id string) (*Policy, *APIResponse, error)
- func (a PolicyApi) ListPolicies(offset int64, limit int64) ([]Policy, *APIResponse, error)
- func (a PolicyApi) UpdatePolicy(id string, body Policy) (*Policy, *APIResponse, error)
- type PolicyConditions
- type Role
- type RoleApi
- func (a RoleApi) AddMembersToRole(id string, body RoleMembers) (*APIResponse, error)
- func (a RoleApi) CreateRole(body Role) (*Role, *APIResponse, error)
- func (a RoleApi) DeleteRole(id string) (*APIResponse, error)
- func (a RoleApi) GetRole(id string) (*Role, *APIResponse, error)
- func (a RoleApi) ListRoles(member string, limit int64, offset int64) ([]Role, *APIResponse, error)
- func (a RoleApi) RemoveMembersFromRole(id string, body RoleMembers) (*APIResponse, error)
- func (a RoleApi) SetRole() (*APIResponse, error)
- type RoleMembers
- type Session
- type SwaggerCreatePolicyParameters
- type SwaggerDoesWardenAllowAccessRequestParameters
- type SwaggerDoesWardenAllowClientRequestParameters
- type SwaggerDoesWardenAllowTokenAccessRequestParameters
- type SwaggerGetPolicyParameters
- type SwaggerListPolicyParameters
- type SwaggerListPolicyResponse
- type SwaggerUpdatePolicyParameters
- type SwaggerWardenBaseRequest
- type Version
- type VersionApi
- type WardenApi
- func (a WardenApi) IsOAuth2AccessTokenAuthorized(body WardenOAuth2AccessTokenAuthorizationRequest) (*WardenOAuth2AccessTokenAuthorizationResponse, *APIResponse, error)
- func (a WardenApi) IsOAuth2ClientAuthorized(body WardenOAuth2ClientAuthorizationRequest) (*WardenOAuth2ClientAuthorizationResponse, *APIResponse, error)
- func (a WardenApi) IsSubjectAuthorized(body WardenSubjectAuthorizationRequest) (*WardenSubjectAuthorizationResponse, *APIResponse, error)
- type WardenOAuth2AccessTokenAuthorizationRequest
- type WardenOAuth2AccessTokenAuthorizationResponse
- type WardenOAuth2ClientAuthorizationRequest
- type WardenOAuth2ClientAuthorizationResponse
- type WardenSubjectAuthorizationRequest
- type WardenSubjectAuthorizationResponse
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
func (*APIClient) ParameterToString ¶
func (*APIClient) SelectHeaderAccept ¶
func (*APIClient) SelectHeaderContentType ¶
type APIResponse ¶
type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` // Operation is the name of the swagger operation. Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. Payload []byte `json:"-"` }
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
type AuthenticationDefaultSession ¶
type AuthenticationDefaultSession struct { // Allowed is true if the request is allowed and false otherwise. Allowed bool `json:"allowed,omitempty"` // Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. Sub string `json:"sub,omitempty"` }
type AuthenticationOAuth2ClientCredentialsSession ¶
type AuthenticationOAuth2ClientCredentialsSession struct { // Allowed is true if the request is allowed and false otherwise. Allowed bool `json:"allowed,omitempty"` // Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. Sub string `json:"sub,omitempty"` }
type AuthenticationOAuth2Session ¶
type AuthenticationOAuth2Session struct { // Allowed is true if the request is allowed and false otherwise. Allowed bool `json:"allowed,omitempty"` Aud []string `json:"aud,omitempty"` // ClientID is the id of the OAuth2 client that requested the token. ClientId string `json:"client_id,omitempty"` // ExpiresAt is the expiry timestamp. Exp time.Time `json:"exp,omitempty"` // IssuedAt is the token creation time stamp. Iat time.Time `json:"iat,omitempty"` // Issuer is the id of the issuer, typically an hydra instance. Iss string `json:"iss,omitempty"` Nbf time.Time `json:"nbf,omitempty"` // GrantedScopes is a list of scopes that the subject authorized when asked for consent. Scope string `json:"scope,omitempty"` // Session represents arbitrary session data. Session map[string]interface{} `json:"session,omitempty"` // Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. Sub string `json:"sub,omitempty"` Username string `json:"username,omitempty"` }
type Authenticator ¶
type Authenticator struct { }
type Configuration ¶
type Configuration struct { Username string `json:"userName,omitempty"` Password string `json:"password,omitempty"` APIKeyPrefix map[string]string `json:"APIKeyPrefix,omitempty"` APIKey map[string]string `json:"APIKey,omitempty"` Debug bool `json:"debug,omitempty"` DebugFile string `json:"debugFile,omitempty"` OAuthToken string `json:"oAuthToken,omitempty"` BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` AccessToken string `json:"accessToken,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` APIClient *APIClient Transport http.RoundTripper Timeout *time.Duration `json:"timeout,omitempty"` }
func NewConfiguration ¶
func NewConfiguration() *Configuration
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
func (*Configuration) GetAPIKeyWithPrefix ¶
func (c *Configuration) GetAPIKeyWithPrefix(APIKeyIdentifier string) string
func (*Configuration) GetBasicAuthEncodedString ¶
func (c *Configuration) GetBasicAuthEncodedString() string
type HealthApi ¶
type HealthApi struct {
Configuration *Configuration
}
func NewHealthApi ¶
func NewHealthApi() *HealthApi
func (HealthApi) IsInstanceAlive ¶
func (a HealthApi) IsInstanceAlive() (*HealthStatus, *APIResponse, error)
*
- Check the Alive Status
- This endpoint returns a 200 status code when the HTTP server is up running. This status does currently not include checks whether the database connection is working. This endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set. Be aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance. *
- @return *HealthStatus
func (HealthApi) IsInstanceReady ¶
func (a HealthApi) IsInstanceReady() (*HealthStatus, *APIResponse, error)
*
- Check the Readiness Status
- This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. the database) are responsive as well. This status does currently not include checks whether the database connection is working. This endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set. Be aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance. *
- @return *HealthStatus
type HealthNotReadyStatus ¶
type HealthStatus ¶
type HealthStatus struct { // Status always contains \"ok\". Status string `json:"status,omitempty"` }
type InlineResponse500 ¶
type IntrospectionResponse ¶
type IntrospectionResponse struct { Active bool `json:"active,omitempty"` Aud []string `json:"aud,omitempty"` ClientId string `json:"client_id,omitempty"` Exp int64 `json:"exp,omitempty"` // Session represents arbitrary session data. Ext map[string]interface{} `json:"ext,omitempty"` Iat int64 `json:"iat,omitempty"` Iss string `json:"iss,omitempty"` Nbf int64 `json:"nbf,omitempty"` Scope string `json:"scope,omitempty"` // Here, it's sub Sub string `json:"sub,omitempty"` TokenType string `json:"token_type,omitempty"` Username string `json:"username,omitempty"` }
type OAuth2ClientCredentialsAuthentication ¶
type OAuth2ClientCredentialsAuthentication struct { }
type OAuth2IntrospectionAuthentication ¶
type OAuth2IntrospectionAuthentication struct { }
type Policy ¶
type Policy struct { // Actions impacted by the policy. Actions []string `json:"actions,omitempty"` // Conditions under which the policy is active. Conditions map[string]PolicyConditions `json:"conditions,omitempty"` // Description of the policy. Description string `json:"description,omitempty"` // Effect of the policy Effect string `json:"effect,omitempty"` // ID of the policy. Id string `json:"id,omitempty"` // Resources impacted by the policy. Resources []string `json:"resources,omitempty"` // Subjects impacted by the policy. Subjects []string `json:"subjects,omitempty"` }
type PolicyApi ¶
type PolicyApi struct {
Configuration *Configuration
}
func NewPolicyApi ¶
func NewPolicyApi() *PolicyApi
func (PolicyApi) CreatePolicy ¶
func (a PolicyApi) CreatePolicy(body Policy) (*Policy, *APIResponse, error)
*
* * Create an Access Control Policy * * @param body * @return *Policy
func (PolicyApi) DeletePolicy ¶
func (a PolicyApi) DeletePolicy(id string) (*APIResponse, error)
*
* * Delete an Access Control Policy * * @param id The id of the policy. * @return void
func (PolicyApi) GetPolicy ¶
func (a PolicyApi) GetPolicy(id string) (*Policy, *APIResponse, error)
*
* * Get an Access Control Policy * * @param id The id of the policy. * @return *Policy
func (PolicyApi) ListPolicies ¶
*
* * List Access Control Policies * * @param offset The offset from where to start looking. * @param limit The maximum amount of policies returned. * @return []Policy
func (PolicyApi) UpdatePolicy ¶
*
* * Update an Access Control Policy * * @param id The id of the policy. * @param body * @return *Policy
type PolicyConditions ¶
type Role ¶
type Role struct { // ID is the role's unique id. Id string `json:"id,omitempty"` // Members is who belongs to the role. Members []string `json:"members,omitempty"` }
Role represents a group of users that share the same role. A role could be an administrator, a moderator, a regular user or some other sort of role.
type RoleApi ¶
type RoleApi struct {
Configuration *Configuration
}
func NewRoleApi ¶
func NewRoleApi() *RoleApi
func NewRoleApiWithBasePath ¶
func (RoleApi) AddMembersToRole ¶
func (a RoleApi) AddMembersToRole(id string, body RoleMembers) (*APIResponse, error)
*
- Add members to a role
- A Role represents a group of users that share the same role and thus permissions. A role could be an administrator, a moderator, a regular user or some other sort of role. This endpoint allows you to add members (users, applications, ...) to a specific role. You have to know the role's ID. *
- @param id The id of the role to modify.
- @param body
- @return void
func (RoleApi) CreateRole ¶
func (a RoleApi) CreateRole(body Role) (*Role, *APIResponse, error)
*
- Create a role
- A Role represents a group of users that share the same role and thus permissions. A role could be an administrator, a moderator, a regular user or some other sort of role. This endpoint allows you to create a new role. You may define members as well but you don't have to. *
- @param body
- @return *Role
func (RoleApi) DeleteRole ¶
func (a RoleApi) DeleteRole(id string) (*APIResponse, error)
*
- Get a role by its ID
- A Role represents a group of users that share the same role and thus permissions. A role could be an administrator, a moderator, a regular user or some other sort of role. This endpoint allows you to delete an existing role. You have to know the role's ID. *
- @param id The id of the role to look up.
- @return void
func (RoleApi) GetRole ¶
func (a RoleApi) GetRole(id string) (*Role, *APIResponse, error)
*
- Get a role by its ID
- A Role represents a group of users that share the same role and thus permissions. A role could be an administrator, a moderator, a regular user or some other sort of role. This endpoint allows you to retrieve an existing role. You have to know the role's ID. *
- @param id The id of the role to look up.
- @return *Role
func (RoleApi) ListRoles ¶
*
- List all roles
- A Role represents a group of users that share the same role and thus permissions. A role could be an administrator, a moderator, a regular user or some other sort of role. This endpoint allows you to retrieve all roles that are stored in the system. *
- @param member The id of the member to look up.
- @param limit The maximum amount of policies returned.
- @param offset The offset from where to start looking.
- @return []Role
func (RoleApi) RemoveMembersFromRole ¶
func (a RoleApi) RemoveMembersFromRole(id string, body RoleMembers) (*APIResponse, error)
*
- Remove members from a role
- A Role represents a group of users that share the same role and thus permissions. A role could be an administrator, a moderator, a regular user or some other sort of role. This endpoint allows you to remove members (users, applications, ...) from a specific role. You have to know the role's ID. *
- @param id The id of the role to modify.
- @param body
- @return void
func (RoleApi) SetRole ¶
func (a RoleApi) SetRole() (*APIResponse, error)
*
- A Role represents a group of users that share the same role and thus permissions. A role could be an administrator, a moderator, a regular user or some other sort of role.
- This endpoint allows you to overwrite a role. You have to know the role's ID. *
- @return void
type RoleMembers ¶
type RoleMembers struct {
Members []string `json:"members,omitempty"`
}
type SwaggerCreatePolicyParameters ¶
type SwaggerCreatePolicyParameters struct {
Body Policy `json:"Body,omitempty"`
}
type SwaggerDoesWardenAllowAccessRequestParameters ¶
type SwaggerDoesWardenAllowAccessRequestParameters struct {
Body WardenSubjectAuthorizationRequest `json:"Body,omitempty"`
}
type SwaggerDoesWardenAllowClientRequestParameters ¶
type SwaggerDoesWardenAllowClientRequestParameters struct {
Body WardenOAuth2ClientAuthorizationRequest `json:"Body,omitempty"`
}
type SwaggerDoesWardenAllowTokenAccessRequestParameters ¶
type SwaggerDoesWardenAllowTokenAccessRequestParameters struct {
Body WardenOAuth2AccessTokenAuthorizationRequest `json:"Body,omitempty"`
}
type SwaggerGetPolicyParameters ¶
type SwaggerGetPolicyParameters struct { // The id of the policy. in: path Id string `json:"id,omitempty"` }
type SwaggerListPolicyResponse ¶
type SwaggerListPolicyResponse struct { // in: body type: array Body []Policy `json:"Body,omitempty"` }
A policy
type SwaggerWardenBaseRequest ¶
type SwaggerWardenBaseRequest struct { // Action is the action that is requested on the resource. Action string `json:"action,omitempty"` // Context is the request's environmental context. Context map[string]interface{} `json:"context,omitempty"` // Resource is the resource that access is requested to. Resource string `json:"resource,omitempty"` }
swager:model authorizedBaseRequest
type VersionApi ¶
type VersionApi struct {
Configuration *Configuration
}
func NewVersionApi ¶
func NewVersionApi() *VersionApi
func NewVersionApiWithBasePath ¶
func NewVersionApiWithBasePath(basePath string) *VersionApi
func (VersionApi) GetVersion ¶
func (a VersionApi) GetVersion() (*Version, *APIResponse, error)
*
- Get the version of Keto
- This endpoint returns the version as `{ \"version\": \"VERSION\" }`. The version is only correct with the prebuilt binary and not custom builds. *
- @return *Version
type WardenApi ¶
type WardenApi struct {
Configuration *Configuration
}
func NewWardenApi ¶
func NewWardenApi() *WardenApi
func (WardenApi) IsOAuth2AccessTokenAuthorized ¶
func (a WardenApi) IsOAuth2AccessTokenAuthorized(body WardenOAuth2AccessTokenAuthorizationRequest) (*WardenOAuth2AccessTokenAuthorizationResponse, *APIResponse, error)
*
- Check if an OAuth 2.0 access token is authorized to access a resource
- Checks if a token is valid and if the token subject is allowed to perform an action on a resource. This endpoint requires a token, a scope, a resource name, an action name and a context. If a token is expired/invalid, has not been granted the requested scope or the subject is not allowed to perform the action on the resource, this endpoint returns a 200 response with `{ \"allowed\": false }`. This endpoint passes all data from the upstream OAuth 2.0 token introspection endpoint. If you use ORY Hydra as an upstream OAuth 2.0 provider, data set through the `accessTokenExtra` field in the consent flow will be included in this response as well. *
- @param body
- @return *WardenOAuth2AccessTokenAuthorizationResponse
func (WardenApi) IsOAuth2ClientAuthorized ¶
func (a WardenApi) IsOAuth2ClientAuthorized(body WardenOAuth2ClientAuthorizationRequest) (*WardenOAuth2ClientAuthorizationResponse, *APIResponse, error)
*
- Check if an OAuth 2.0 Client is authorized to access a resource
- Checks if an OAuth 2.0 Client provided the correct access credentials and and if the client is allowed to perform an action on a resource. This endpoint requires a client id, a client secret, a scope, a resource name, an action name and a context. *
- @param body
- @return *WardenOAuth2ClientAuthorizationResponse
func (WardenApi) IsSubjectAuthorized ¶
func (a WardenApi) IsSubjectAuthorized(body WardenSubjectAuthorizationRequest) (*WardenSubjectAuthorizationResponse, *APIResponse, error)
*
- Check if a subject is authorized to access a resource
- Checks if a subject (e.g. user ID, API key, ...) is allowed to perform a certain action on a resource. *
- @param body
- @return *WardenSubjectAuthorizationResponse
type WardenOAuth2AccessTokenAuthorizationRequest ¶
type WardenOAuth2AccessTokenAuthorizationRequest struct { // Action is the action that is requested on the resource. Action string `json:"action,omitempty"` // Context is the request's environmental context. Context map[string]interface{} `json:"context,omitempty"` // Resource is the resource that access is requested to. Resource string `json:"resource,omitempty"` // Scope is an array of scopes that are required. Scope []string `json:"scope,omitempty"` // Token is the token to introspect. Token string `json:"token,omitempty"` }
type WardenOAuth2AccessTokenAuthorizationResponse ¶
type WardenOAuth2AccessTokenAuthorizationResponse struct { // Allowed is true if the request is allowed and false otherwise. Allowed bool `json:"allowed,omitempty"` Aud []string `json:"aud,omitempty"` // ClientID is the id of the OAuth2 client that requested the token. ClientId string `json:"client_id,omitempty"` // ExpiresAt is the expiry timestamp. Exp time.Time `json:"exp,omitempty"` // IssuedAt is the token creation time stamp. Iat time.Time `json:"iat,omitempty"` // Issuer is the id of the issuer, typically an hydra instance. Iss string `json:"iss,omitempty"` Nbf time.Time `json:"nbf,omitempty"` // GrantedScopes is a list of scopes that the subject authorized when asked for consent. Scope string `json:"scope,omitempty"` // Session represents arbitrary session data. Session map[string]interface{} `json:"session,omitempty"` // Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. Sub string `json:"sub,omitempty"` Username string `json:"username,omitempty"` }
type WardenOAuth2ClientAuthorizationRequest ¶
type WardenOAuth2ClientAuthorizationRequest struct { // Action is the action that is requested on the resource. Action string `json:"action,omitempty"` // Token is the token to introspect. ClientId string `json:"client_id,omitempty"` ClientSecret string `json:"client_secret,omitempty"` // Context is the request's environmental context. Context map[string]interface{} `json:"context,omitempty"` // Resource is the resource that access is requested to. Resource string `json:"resource,omitempty"` // Scope is an array of scopes that are required. Scope []string `json:"scope,omitempty"` }
type WardenOAuth2ClientAuthorizationResponse ¶
type WardenOAuth2ClientAuthorizationResponse struct { // Allowed is true if the request is allowed and false otherwise. Allowed bool `json:"allowed,omitempty"` // Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. Sub string `json:"sub,omitempty"` }
type WardenSubjectAuthorizationRequest ¶
type WardenSubjectAuthorizationRequest struct { // Action is the action that is requested on the resource. Action string `json:"action,omitempty"` // Context is the request's environmental context. Context map[string]interface{} `json:"context,omitempty"` // Resource is the resource that access is requested to. Resource string `json:"resource,omitempty"` // Subejct is the subject that is requesting access. Subject string `json:"subject,omitempty"` }
type WardenSubjectAuthorizationResponse ¶
type WardenSubjectAuthorizationResponse struct { // Allowed is true if the request is allowed and false otherwise. Allowed bool `json:"allowed,omitempty"` // Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. Sub string `json:"sub,omitempty"` }
Source Files ¶
- api_client.go
- api_response.go
- authentication_default_session.go
- authentication_o_auth2_client_credentials_request.go
- authentication_o_auth2_client_credentials_session.go
- authentication_o_auth2_introspection_request.go
- authentication_o_auth2_session.go
- authenticator.go
- configuration.go
- firewall.go
- handler.go
- health_api.go
- health_not_ready_status.go
- health_status.go
- inline_response_500.go
- introspection_response.go
- manager.go
- o_auth2_client_credentials_authentication.go
- o_auth2_introspection_authentication.go
- policy.go
- policy_api.go
- policy_conditions.go
- role.go
- role_api.go
- role_members.go
- session.go
- swagger_create_policy_parameters.go
- swagger_does_warden_allow_access_request_parameters.go
- swagger_does_warden_allow_client_request_parameters.go
- swagger_does_warden_allow_token_access_request_parameters.go
- swagger_get_policy_parameters.go
- swagger_list_policy_parameters.go
- swagger_list_policy_response.go
- swagger_update_policy_parameters.go
- swagger_warden_base_request.go
- version.go
- version_api.go
- warden_api.go
- warden_o_auth2_access_token_authorization_request.go
- warden_o_auth2_access_token_authorization_response.go
- warden_o_auth2_client_authorization_request.go
- warden_o_auth2_client_authorization_response.go
- warden_subject_authorization_request.go
- warden_subject_authorization_response.go
- writer.go
Click to show internal directories.
Click to hide internal directories.