Documentation
¶
Overview ¶
Package authorityclient calls the authority API.
responses cannot exceed 64 KiB. a successful response other than HTTP 204 must contain one non-null JSON value that matches the generated schema. numbers in open objects stay as json.Number. requests time out after 20 seconds and do not follow redirects. network and read failures wrap ErrUnavailable, but caller cancellation, invalid responses, and oversized responses do not. HTTP 429 and 503 are classified before their bodies are read.
Index ¶
- Variables
- func ValidateControlSessionResponse(response authorityv1.ControlSessionResponse, expectedSessionID string, ...) (clientstate.ControlSession, error)
- type Client
- func (c *Client) AcceptInvitation(ctx context.Context, secret string) (authorityv1.Membership, error)
- func (c *Client) AuthorizeServiceOperation(ctx context.Context, serviceSecret string, ...) (authorityv1.ServiceAuthorizationDecision, error)
- func (c *Client) ClaimTeamDomain(ctx context.Context, teamID, domain, idempotencyKey string, makeDefault bool) (authorityv1.Domain, error)
- func (c *Client) CreateTeam(ctx context.Context, body authorityv1.CreateTeamRequest, idempotencyKey string) (authorityv1.Team, error)
- func (c *Client) CreateTeamInvitation(ctx context.Context, teamID string, body authorityv1.CreateInvitationRequest, ...) (authorityv1.InvitationSecret, error)
- func (c *Client) Exchange(ctx context.Context, token credentials.LoginToken) (authorityv1.ControlSessionResponse, error)
- func (c *Client) ExchangeOIDC(ctx context.Context, token string) (authorityv1.ControlSessionResponse, error)
- func (c *Client) GetTeam(ctx context.Context, teamID string) (authorityv1.Team, error)
- func (c *Client) IdentityContext(ctx context.Context) (authorityv1.IdentityContext, error)
- func (c *Client) IdentityContextWithAccessToken(ctx context.Context, token credentials.AccessToken) (authorityv1.IdentityContext, error)
- func (c *Client) ListTeamDomains(ctx context.Context, teamID string) (authorityv1.DomainPage, error)
- func (c *Client) ListTeamInvitations(ctx context.Context, teamID string) (authorityv1.InvitationPage, error)
- func (c *Client) ListTeamMemberships(ctx context.Context, teamID string) (authorityv1.MembershipPage, error)
- func (c *Client) ListTeams(ctx context.Context) (authorityv1.TeamPage, error)
- func (c *Client) LogoutWithAccessToken(ctx context.Context, token credentials.AccessToken) error
- func (c *Client) Refresh(ctx context.Context, token credentials.RefreshToken) (authorityv1.ControlSessionResponse, error)
- func (c *Client) ReleaseTeamDomain(ctx context.Context, teamID, domainID string) error
- func (c *Client) RemoveMembership(ctx context.Context, teamID, membershipID string) error
- func (c *Client) RevokeTeamInvitation(ctx context.Context, teamID, invitationID string) error
- func (c *Client) SetMembershipRole(ctx context.Context, teamID, membershipID string, role authorityv1.TeamRole) (authorityv1.Membership, error)
- func (c *Client) SetTeamDefaultDomain(ctx context.Context, teamID, domainID string) (authorityv1.Team, error)
- type ProblemError
- type RateLimitError
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ValidateControlSessionResponse ¶
func ValidateControlSessionResponse(response authorityv1.ControlSessionResponse, expectedSessionID string, expectedRefreshExpiry time.Time) (clientstate.ControlSession, error)
ValidateControlSessionResponse checks credentials and session data returned by the authority.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(endpoint string, httpClient *http.Client, access credentials.AccessToken) (*Client, error)
func (*Client) AcceptInvitation ¶
func (c *Client) AcceptInvitation(ctx context.Context, secret string) (authorityv1.Membership, error)
func (*Client) AuthorizeServiceOperation ¶
func (c *Client) AuthorizeServiceOperation( ctx context.Context, serviceSecret string, body authorityv1.ServiceAuthorizationRequest, ) (authorityv1.ServiceAuthorizationDecision, error)
AuthorizeServiceOperation asks the external authority to authorize an operation. it uses the hosted secret instead of the user's access token.
func (*Client) ClaimTeamDomain ¶
func (*Client) CreateTeam ¶
func (c *Client) CreateTeam(ctx context.Context, body authorityv1.CreateTeamRequest, idempotencyKey string) (authorityv1.Team, error)
func (*Client) CreateTeamInvitation ¶
func (c *Client) CreateTeamInvitation(ctx context.Context, teamID string, body authorityv1.CreateInvitationRequest, idempotencyKey string) (authorityv1.InvitationSecret, error)
func (*Client) Exchange ¶
func (c *Client) Exchange(ctx context.Context, token credentials.LoginToken) (authorityv1.ControlSessionResponse, error)
func (*Client) ExchangeOIDC ¶
func (c *Client) ExchangeOIDC(ctx context.Context, token string) (authorityv1.ControlSessionResponse, error)
func (*Client) IdentityContext ¶
func (c *Client) IdentityContext(ctx context.Context) (authorityv1.IdentityContext, error)
func (*Client) IdentityContextWithAccessToken ¶
func (c *Client) IdentityContextWithAccessToken( ctx context.Context, token credentials.AccessToken, ) (authorityv1.IdentityContext, error)
func (*Client) ListTeamDomains ¶
func (c *Client) ListTeamDomains(ctx context.Context, teamID string) (authorityv1.DomainPage, error)
func (*Client) ListTeamInvitations ¶
func (c *Client) ListTeamInvitations(ctx context.Context, teamID string) (authorityv1.InvitationPage, error)
func (*Client) ListTeamMemberships ¶
func (c *Client) ListTeamMemberships(ctx context.Context, teamID string) (authorityv1.MembershipPage, error)
func (*Client) LogoutWithAccessToken ¶
func (c *Client) LogoutWithAccessToken(ctx context.Context, token credentials.AccessToken) error
func (*Client) Refresh ¶
func (c *Client) Refresh(ctx context.Context, token credentials.RefreshToken) (authorityv1.ControlSessionResponse, error)
func (*Client) ReleaseTeamDomain ¶
func (*Client) RemoveMembership ¶
func (*Client) RevokeTeamInvitation ¶
func (*Client) SetMembershipRole ¶
func (c *Client) SetMembershipRole(ctx context.Context, teamID, membershipID string, role authorityv1.TeamRole) (authorityv1.Membership, error)
func (*Client) SetTeamDefaultDomain ¶
type ProblemError ¶
type ProblemError struct {
Status int
Problem authorityv1.Problem
}
func (*ProblemError) Error ¶
func (e *ProblemError) Error() string
type RateLimitError ¶
func (*RateLimitError) Error ¶
func (e *RateLimitError) Error() string
func (*RateLimitError) Unwrap ¶
func (e *RateLimitError) Unwrap() error