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 about infrastructure security.

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,
]);

See also

Last updated on Nov 14, 2024