usersessions

package
v0.0.0-...-621b8cf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const APIName = "gram"

APIName is the name of the API as defined in the design.

View Source
const APIVersion = "0.0.1"

APIVersion is the version of the API as defined in the design.

View Source
const ServiceName = "userSessions"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [2]string{"listUserSessions", "revokeUserSession"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func MakeBadRequest

func MakeBadRequest(err error) *goa.ServiceError

MakeBadRequest builds a goa.ServiceError from an error.

func MakeConflict

func MakeConflict(err error) *goa.ServiceError

MakeConflict builds a goa.ServiceError from an error.

func MakeForbidden

func MakeForbidden(err error) *goa.ServiceError

MakeForbidden builds a goa.ServiceError from an error.

func MakeGatewayError

func MakeGatewayError(err error) *goa.ServiceError

MakeGatewayError builds a goa.ServiceError from an error.

func MakeInvalid

func MakeInvalid(err error) *goa.ServiceError

MakeInvalid builds a goa.ServiceError from an error.

func MakeInvariantViolation

func MakeInvariantViolation(err error) *goa.ServiceError

MakeInvariantViolation builds a goa.ServiceError from an error.

func MakeNotFound

func MakeNotFound(err error) *goa.ServiceError

MakeNotFound builds a goa.ServiceError from an error.

func MakeUnauthorized

func MakeUnauthorized(err error) *goa.ServiceError

MakeUnauthorized builds a goa.ServiceError from an error.

func MakeUnexpected

func MakeUnexpected(err error) *goa.ServiceError

MakeUnexpected builds a goa.ServiceError from an error.

func MakeUnsupportedMedia

func MakeUnsupportedMedia(err error) *goa.ServiceError

MakeUnsupportedMedia builds a goa.ServiceError from an error.

func NewListUserSessionsEndpoint

func NewListUserSessionsEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint

NewListUserSessionsEndpoint returns an endpoint function that calls the method "listUserSessions" of service "userSessions".

func NewRevokeUserSessionEndpoint

func NewRevokeUserSessionEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint

NewRevokeUserSessionEndpoint returns an endpoint function that calls the method "revokeUserSession" of service "userSessions".

Types

type Auther

type Auther interface {
	// APIKeyAuth implements the authorization logic for the APIKey security scheme.
	APIKeyAuth(ctx context.Context, key string, schema *security.APIKeyScheme) (context.Context, error)
}

Auther defines the authorization functions to be implemented by the service.

type Client

type Client struct {
	ListUserSessionsEndpoint  goa.Endpoint
	RevokeUserSessionEndpoint goa.Endpoint
}

Client is the "userSessions" service client.

func NewClient

func NewClient(listUserSessions, revokeUserSession goa.Endpoint) *Client

NewClient initializes a "userSessions" service client given the endpoints.

func (*Client) ListUserSessions

func (c *Client) ListUserSessions(ctx context.Context, p *ListUserSessionsPayload) (res *ListUserSessionsResult, err error)

ListUserSessions calls the "listUserSessions" endpoint of the "userSessions" service. ListUserSessions may return the following errors:

  • "unauthorized" (type *goa.ServiceError): unauthorized access
  • "forbidden" (type *goa.ServiceError): permission denied
  • "bad_request" (type *goa.ServiceError): request is invalid
  • "not_found" (type *goa.ServiceError): resource not found
  • "conflict" (type *goa.ServiceError): resource already exists
  • "unsupported_media" (type *goa.ServiceError): unsupported media type
  • "invalid" (type *goa.ServiceError): request contains one or more invalidation fields
  • "invariant_violation" (type *goa.ServiceError): an unexpected error occurred
  • "unexpected" (type *goa.ServiceError): an unexpected error occurred
  • "gateway_error" (type *goa.ServiceError): an unexpected error occurred
  • error: internal error

func (*Client) RevokeUserSession

func (c *Client) RevokeUserSession(ctx context.Context, p *RevokeUserSessionPayload) (err error)

RevokeUserSession calls the "revokeUserSession" endpoint of the "userSessions" service. RevokeUserSession may return the following errors:

  • "unauthorized" (type *goa.ServiceError): unauthorized access
  • "forbidden" (type *goa.ServiceError): permission denied
  • "bad_request" (type *goa.ServiceError): request is invalid
  • "not_found" (type *goa.ServiceError): resource not found
  • "conflict" (type *goa.ServiceError): resource already exists
  • "unsupported_media" (type *goa.ServiceError): unsupported media type
  • "invalid" (type *goa.ServiceError): request contains one or more invalidation fields
  • "invariant_violation" (type *goa.ServiceError): an unexpected error occurred
  • "unexpected" (type *goa.ServiceError): an unexpected error occurred
  • "gateway_error" (type *goa.ServiceError): an unexpected error occurred
  • error: internal error

type Endpoints

type Endpoints struct {
	ListUserSessions  goa.Endpoint
	RevokeUserSession goa.Endpoint
}

Endpoints wraps the "userSessions" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "userSessions" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "userSessions" service endpoints.

type ListUserSessionsPayload

type ListUserSessionsPayload struct {
	// Exact-match filter on subject URN.
	SubjectUrn *string
	// Filter by user_session_issuer id.
	UserSessionIssuerID *string
	// Pagination cursor: id of the last item from the previous page.
	Cursor *string
	// Page size (default 50, max 100).
	Limit            *int
	SessionToken     *string
	ApikeyToken      *string
	ProjectSlugInput *string
}

ListUserSessionsPayload is the payload type of the userSessions service listUserSessions method.

type ListUserSessionsResult

type ListUserSessionsResult struct {
	Items []*types.UserSession
	// Cursor for the next page; empty when exhausted.
	NextCursor *string
}

ListUserSessionsResult is the result type of the userSessions service listUserSessions method.

type RevokeUserSessionPayload

type RevokeUserSessionPayload struct {
	// The user_session id.
	ID               string
	SessionToken     *string
	ApikeyToken      *string
	ProjectSlugInput *string
}

RevokeUserSessionPayload is the payload type of the userSessions service revokeUserSession method.

type Service

type Service interface {
	// List issued user_sessions in the caller's project. refresh_token_hash is
	// never returned.
	ListUserSessions(context.Context, *ListUserSessionsPayload) (res *ListUserSessionsResult, err error)
	// Push the session's jti into the revocation cache and soft-delete the row.
	RevokeUserSession(context.Context, *RevokeUserSessionPayload) (err error)
}

Operator visibility into issued user_sessions. List + revoke; sessions are written by /mcp/{slug}/token.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL