API Key Manager
TsgcWSAPIKeyManager——对 sgcWebSockets 服务器所签发 API 密钥的完整生命周期管理。生成、哈希、验证、轮换、撤销及审计——全部通过一个可拖放到表单的组件完成。
TsgcWSAPIKeyManager——对 sgcWebSockets 服务器所签发 API 密钥的完整生命周期管理。生成、哈希、验证、轮换、撤销及审计——全部通过一个可拖放到表单的组件完成。
API 密钥验证器。将其接入 TsgcWebSocketHTTPServer(或 HTTP-API 服务器),每个传入连接都将通过单一事件与您的密钥存储进行验证。
TsgcWSAPIKeyManager
服务器端准入控制。
Windows, macOS, Linux, iOS, Android
Professional / Enterprise
挂载 OnAPIKeyAuthenticate 事件,绑定到服务器,完成。
uses
sgcWebSocket, sgcWebSocket_Server, sgcAPIKeyManager;
var
Keys: TsgcWSAPIKeyManager;
WSServer: TsgcWebSocketHTTPServer;
begin
Keys := TsgcWSAPIKeyManager.Create(nil);
Keys.OnAPIKeyAuthenticate := DoAuth;
WSServer := TsgcWebSocketHTTPServer.Create(nil);
WSServer.Port := 80;
WSServer.APIKeyManager := Keys;
WSServer.Active := True;
end;
procedure TForm1.DoAuth(Sender: TObject;
const aKey: string; var Authenticated: Boolean);
begin
Authenticated := IsValidKey(aKey);
end;
10 个已发布属性、26 个方法、7 个事件——摘自组件参考文档。
属性:Enabled。
属性:Generation、Hashing。
属性:Storage。
属性:Scopes、Validation、Expiration。
属性:RateLimit。
属性:Audit。