Struct AuthConfig

Struct Documentation

struct AuthConfig

Authentication configuration @verifies REQ_INTEROP_086, REQ_INTEROP_087.

Public Members

bool enabled = {false}

Whether authentication is enabled.

std::string jwt_secret

Secret for HS256 or path to private key for RS256.

std::string jwt_public_key

Path to public key for RS256 (optional)

JwtAlgorithm jwt_algorithm = {JwtAlgorithm::HS256}

JWT signing algorithm.

int token_expiry_seconds = {3600}

Access token validity (default: 1 hour)

int refresh_token_expiry_seconds = {86400}

Refresh token validity (default: 24 hours)

AuthRequirement require_auth_for = {AuthRequirement::WRITE}

When to require authentication.

std::string issuer = {"ros2_medkit_gateway"}

JWT issuer claim.

std::vector<ClientCredentials> clients

Public Static Functions

static const std::unordered_map<UserRole, std::unordered_set<std::string>> &get_role_permissions()