Algorithmic Trading Platform

Contracts / Interface

Overview

Interface for authentication and identity services. Uses local authentication in prototype; designed for future external identity provider integration.

Contract

Consumers

  • AuthenticationAndAuthorizationService
  • UserInterfaceDashboard

Types

NameBaseConstraints / ValuesDescription
AuthTokenobjectJWT or session token returned on successful authentication
AuthResultobjectResult of an authentication or authorization check

Operations

authenticate

Verify credentials and return an auth token.

ParameterTypeRequiredConstraints
usernamestr
passwordstr

Returns: AuthToken — JWT token with expiry and roles

Errors: AuthenticationError

authorize

Check whether a token holder has a required role.

ParameterTypeRequiredConstraints
tokenstr
required_rolestr

Returns: AuthResult — Authorization result with user_id and roles

Errors: TokenExpiredError, InvalidTokenError

revoke

Invalidate an active token (logout).

ParameterTypeRequiredConstraints
tokenstr

Returns: None

Referenced By 1

Architecture