CredentialProvider class abstract

Reads and parses API tokens from a string or an environment variable.

final credentialProvider = CredentialProvider.fromEnvironmentVariable("MOMENTO_API_KEY");

or

CredentialProvider.fromString(myApiTokenString);
Implementers

Constructors

CredentialProvider(String _apiKey, String _controlEndpoint, String _cacheEndpoint)

Properties

apiKey String
The API key used to construct the CredentialProvider
no setter
cacheEndpoint String
The URI for the data plane endpoint
no setter
controlEndpoint String
The URI for the control plane endpoint
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Static Methods

fromEnvironmentVariable(String envVarName, {String? baseEndpointOverride, EndpointOverrides? endpointOverrides}) CredentialProvider
Reads and parses an API token stored in an environment variable.
fromString(String apiKey, {String? baseEndpointOverride, EndpointOverrides? endpointOverrides}) CredentialProvider
Reads and parses an API token stored in a string.