ApiKeyService class

API Key Service for managing authentication keys Handles admin key, developer keys, and authentication headers

NOTE: Sensitive logic is now handled in native compiled code. This Dart layer delegates to OnairosCore (AAR/XCFramework).

Constructors

ApiKeyService()
factory

Properties

apiBaseUrl String
Get API base URL (from native code)
no setter
currentApiKey String?
Get current API key
no setter
environment String?
Get current environment
no setter
hashCode int
The hash code for this object.
no setterinherited
isInitialized bool
Check if the service is initialized
no setter
isUsingAdminKey bool
Check if current key is admin key (null means using admin from native code)
no setter
isUsingDeveloperKey bool
Check if current key is developer key
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

authenticatedGet(String endpoint, {String? jwtToken}) Future<Map<String, dynamic>>
Make authenticated HTTP GET request
authenticatedPost(String endpoint, {Map<String, dynamic>? body, String? jsonBody, String? jwtToken}) Future<Map<String, dynamic>>
Make authenticated HTTP POST request
clearApiKey() Future<void>
Clear stored API key
getAuthHeaders({String? jwtToken}) Map<String, String>
Get authentication headers for API requests Uses native core for secure header generation when possible
getSecureAuthHeaders() Future<Map<String, String>>
Get authentication headers from native code (async, more secure)
initialize({String? apiKey, String? environment, bool autoInitWithAdmin = true, bool enableLogging = false, int timeout = 30000, int retryAttempts = 3, bool offlineMode = false}) Future<void>
Initialize the API key service with proper validation Delegates to native compiled code for sensitive operations
loadFromStorage() Future<void>
Load configuration from storage
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited