Documentation ¶
Index ¶
- func ErrorDecoder(r *http.Response) error
- func ErrorEncoder(_ context.Context, err error, w http.ResponseWriter)
- func LoggingMiddleware(svc authn.Service, logger log.Logger) authn.Service
- func MakeHTTPHandler(svc authn.Service) http.Handler
- func MakeIdentifyEndpoint(svc authn.Service) endpoint.Endpoint
- func MakeIssueEndpoint(svc authn.Service) endpoint.Endpoint
- func MakeRetrieveEndpoint(svc authn.Service) endpoint.Endpoint
- func MakeRevokeEndpoint(svc authn.Service) endpoint.Endpoint
- type Endpoints
- func (e Endpoints) Identify(ctx context.Context, token string) (identity authn.Identity, err error)
- func (e Endpoints) Issue(ctx context.Context, token string, key authn.Key) (k authn.Key, t string, err error)
- func (e Endpoints) Retrieve(ctx context.Context, token string, id string) (key authn.Key, err error)
- func (e Endpoints) Revoke(ctx context.Context, token string, id string) (err error)
- type GenericRequest
- type IdentifyResponse
- type IssueRequest
- type IssueResponse
- type RetrieveResponse
- type RevokeResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorDecoder ¶
func ErrorEncoder ¶
func ErrorEncoder(_ context.Context, err error, w http.ResponseWriter)
func LoggingMiddleware ¶
LoggingMiddleware adds logging facilities to the core service.
func MakeHTTPHandler ¶
MakeHandler returns a HTTP handler for API endpoints.
func MakeIdentifyEndpoint ¶
MakeIdentifyEndpoint returns an api that invokes Identify on the service.
func MakeIssueEndpoint ¶
MakeIssueEndpoint returns an api that invokes Issue on the service.
func MakeRetrieveEndpoint ¶
MakeRetrieveEndpoint returns an api that invokes Retrieve on the service.
Types ¶
type Endpoints ¶
type Endpoints struct { IssueEndpoint endpoint.Endpoint RevokeEndpoint endpoint.Endpoint RetrieveEndpoint endpoint.Endpoint IdentifyEndpoint endpoint.Endpoint }
Endpoints collects all of the endpoints that compose a profile service. It's meant to be used as a helper struct, to collect all of the endpoints into a single parameter.
func NewEndpoints ¶
NewEndpoints returns a Endpoints struct that wraps the provided service
func (Endpoints) Issue ¶
func (e Endpoints) Issue(ctx context.Context, token string, key authn.Key) (k authn.Key, t string, err error)
Issue implements Service. Primarily useful in a client.
type GenericRequest ¶
type GenericRequest struct {
// contains filtered or unexported fields
}
type IdentifyResponse ¶
IdentifyResponse collects the response parameters for the Identify method.
type IssueRequest ¶
type IssueRequest struct { Type uint32 `json:"type,omitempty"` Duration time.Duration `json:"duration,omitempty"` // contains filtered or unexported fields }
IssueRequest collects the request parameters for the Issue method.
type IssueResponse ¶
type IssueResponse struct { ID string `json:"id,omitempty"` Value string `json:"value,omitempty"` IssuedAt time.Time `json:"issued_at,omitempty"` ExpiresAt *time.Time `json:"expires_at,omitempty"` }
IssueResponse collects the response parameters for the Issue method.
func (IssueResponse) Code ¶
func (res IssueResponse) Code() int
func (IssueResponse) Empty ¶
func (res IssueResponse) Empty() bool
func (IssueResponse) Headers ¶
func (res IssueResponse) Headers() map[string]string
type RetrieveResponse ¶
type RetrieveResponse struct { ID string `json:"id,omitempty"` IssuerID string `json:"issuer_id,omitempty"` Subject string `json:"subject,omitempty"` Type uint32 `json:"type,omitempty"` IssuedAt time.Time `json:"issued_at,omitempty"` ExpiresAt *time.Time `json:"expires_at,omitempty"` }
RetrieveResponse collects the response parameters for the Retrieve method.
func (RetrieveResponse) Code ¶
func (res RetrieveResponse) Code() int
func (RetrieveResponse) Empty ¶
func (res RetrieveResponse) Empty() bool
func (RetrieveResponse) Headers ¶
func (res RetrieveResponse) Headers() map[string]string
type RevokeResponse ¶
type RevokeResponse struct{}
RevokeResponse collects the response parameters for the Revoke method.
func (RevokeResponse) Code ¶
func (res RevokeResponse) Code() int
func (RevokeResponse) Empty ¶
func (res RevokeResponse) Empty() bool
func (RevokeResponse) Headers ¶
func (res RevokeResponse) Headers() map[string]string