TsgcWSAPIKeyManagerProperties › Enabled

Enabled Property

Master switch. When False, ValidateKey and IsRequestAuthorized always return True and server auto-hooks become no-ops.

Syntax

property Enabled: Boolean read FEnabled write FEnabled default True;

Default Value

True

Remarks

Master switch for the whole component. When Enabled is False every public method short-circuits to "allowed": ValidateKey and IsRequestAuthorized return True without consulting the key store, IssueKey still works, and the server-side auto-hooks (IsConnectionAllowed, IsMessageAllowed, RegisterConnection, UnregisterConnection) become no-ops. No keys are lost, no scopes change, and the audit log resumes the moment you flip it back on — use the flag for maintenance windows, staging deployments or to quickly bypass enforcement after a misconfiguration without unassigning the component from the server's APIKeyManager property.

Example

// Temporarily bypass API key enforcement during a maintenance window
sgcWSAPIKeyManager1.Enabled := False;
try
  RunMaintenanceTask;
finally
  sgcWSAPIKeyManager1.Enabled := True;
end;

Back to Properties