The Dart SDK is currently in experimental status. If you would like to provide feedback, please reach out to us with your suggestions and comments on our Discord.
Dart - secret()
Creates a reference to a secret in the secrets manager.
import 'package:nitric_sdk/nitric.dart';
final keyRef = Nitric.secret("encryptionKey").allow([
SecretPermission.put,
SecretPermission.access,
]);
Parameters
- Name
name
- Required
- Required
- Type
- String
- Description
The unique name of this secret within the secrets manager.
Access
All Nitric resources provide access permissions you can use to specify the level of access your service needs to the resource. See here for details Access Control documentation.
Available permissions:
SecretPermission.put
This permission allows your service to set a new latest value for a secret.
SecretPermission.access
This permission allows your service to retrieve secret values.
Examples
Create a reference to a secret
import 'package:nitric_sdk/nitric.dart';
final keyRef = Nitric.secret("encryptionKey").allow([
SecretPermission.put,
SecretPermission.access,
]);