TsgcWSAPIKeyManager › Methods
Public methods grouped by purpose, followed by the full alphabetical list.
| Name | Description |
|---|---|
| IssueKey | Generates, hashes and stores a new key; returns the plaintext (only time it can be observed). |
| RotateKey | Issues a fresh key for the same owner and scopes and marks the old one kksRotated. |
| RenewKey | Extends the key's expiration by the given number of seconds from now. |
| Name | Description |
|---|---|
| ValidateKey | Validates a raw key and optionally enforces a required scope and records the requester's IP. |
| IsRequestAuthorized | One-shot authorization check: extracts the key from headers or query string and validates it. |
| IsExpired | Returns True if the key is past its expiry. |
| IsRevoked | Returns True if the key is revoked. |
| KeyExists | Returns True if the key is known (active, revoked, expired or rotated). |
| Count | Returns the number of keys currently stored. |
| Name | Description |
|---|---|
| RevokeKey | Marks a key as revoked; subsequent ValidateKey calls return False. |
| PurgeExpired | Removes all keys whose ExpiresAt is in the past. |
| Name | Description |
|---|---|
| GrantScope | Adds a scope to an existing key. |
| RevokeScope | Removes a scope from an existing key. |
| HasScope | Returns True if the key carries the given scope. |
| ListScopes | Returns the scopes attached to a key. |
| Name | Description |
|---|---|
| ExtractKeyFromHeaders | Parses the Validation.HeaderName value out of a raw HTTP header block. |
| ExtractKeyFromQuery | Parses the Validation.QueryParamName value out of a raw query string. |
| Name | Description |
|---|---|
| IsConnectionAllowed | Server hook enforcing the optional IPAllowlist when FailClosed is True. |
| IsMessageAllowed | Server hook called for every inbound message; IP-level no-op by default. |
| RegisterConnection | Tracks a new connection. Called automatically by the server. |
| UnregisterConnection | Releases tracking for a connection. Called automatically on disconnect. |
| Name | Description |
|---|---|
| SaveToFile | Persists keys and audit log to the given file (falls back to Storage.FileName when empty). |
| LoadFromFile | Restores keys and audit log from file. |
| ExportKeys | Stream-based export of keys and audit log. |
| ImportKeys | Stream-based import of keys and audit log. |
| Name | Description |
|---|---|
| ClearAuditLog | Clears the audit log for a specific key or (when empty) for all keys. |
| Name | Description |
|---|---|
| ClearAuditLog | Clears the audit log for a specific key or (when empty) for all keys. |
| Count | Returns the number of keys currently stored. |
| ExportKeys | Stream-based export of keys and audit log. |
| ExtractKeyFromHeaders | Parses the Validation.HeaderName value out of a raw HTTP header block. |
| ExtractKeyFromQuery | Parses the Validation.QueryParamName value out of a raw query string. |
| GrantScope | Adds a scope to an existing key. |
| HasScope | Returns True if the key carries the given scope. |
| ImportKeys | Stream-based import of keys and audit log. |
| IsConnectionAllowed | Server hook enforcing the optional IPAllowlist when FailClosed is True. |
| IsExpired | Returns True if the key is past its expiry. |
| IsMessageAllowed | Server hook called for every inbound message; IP-level no-op by default. |
| IsRequestAuthorized | One-shot authorization check: extracts the key from headers or query string and validates it. |
| IsRevoked | Returns True if the key is revoked. |
| IssueKey | Generates, hashes and stores a new key; returns the plaintext (only time it can be observed). |
| KeyExists | Returns True if the key is known (active, revoked, expired or rotated). |
| ListScopes | Returns the scopes attached to a key. |
| LoadFromFile | Restores keys and audit log from file. |
| PurgeExpired | Removes all keys whose ExpiresAt is in the past. |
| RegisterConnection | Tracks a new connection. Called automatically by the server. |
| RenewKey | Extends the key's expiration by the given number of seconds from now. |
| RevokeKey | Marks a key as revoked; subsequent ValidateKey calls return False. |
| RevokeScope | Removes a scope from an existing key. |
| RotateKey | Issues a fresh key for the same owner and scopes and marks the old one kksRotated. |
| SaveToFile | Persists keys and audit log to the given file (falls back to Storage.FileName when empty). |
| UnregisterConnection | Releases tracking for a connection. Called automatically on disconnect. |
| ValidateKey | Validates a raw key and optionally enforces a required scope and records the requester's IP. |