Skip to content

feat: make token TTL and DoS limits configurable via MicroProfile Config #141

Description

@bmarwell

Motivation

Several constants are currently hard-coded:

Constant Location Value
TOKEN_TTL_HOURS AddKeyToVerificationQueueCommandHandler 24 h
MAX_EMAIL_UIDS same 20
MAX_SUBKEYS (proposed in #136) 50
Max keytext size (proposed in #135) 128 KB

These should be read from MicroProfile Config so operators can tune them per deployment without recompiling.

Implementation

Add @ConfigProperty injection in the handler(s):

@Inject
@ConfigProperty(name = "keyserver.verification.token-ttl-hours", defaultValue = "24")
int tokenTtlHours;

Provide default values matching the current hard-coded values so behaviour is unchanged out of the box.

Document the properties in docs/ or a src/main/liberty/config/ README.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions