gcputil 0.2.0 copy "gcputil: ^0.2.0" to clipboard
gcputil: ^0.2.0 copied to clipboard

Utilities for Dart services running on Google Cloud, including metadata, Secret Manager, Cloud KMS, and Cloud Tasks helpers.

gcputil #

Shared Dart utilities for services running on Google Cloud.

Current helpers cover:

  • Google Cloud project and runtime service account metadata.
  • Secret Manager lookup with environment-variable fallback.
  • Cloud KMS encryption/decryption.
  • Google APIs service-account clients backed by Secret Manager keys.
  • Enqueuing Cloud Tasks requests that invoke Cloud Run jobs.

Usage #

import 'package:gcputil/gcputil.dart';

Future<void> main() async {
  final project = await projectId;
  final apiKey = await secret('my-api-key');

  final key = EncryptionKey(
    name: 'token-key',
    ring: 'application',
    region: 'us-central1',
  );

  final cipher = await encrypt(apiKey, key);
  final plaintext = await decrypt(cipher!, key);

  print('Project: $project');
  print('Recovered secret: $plaintext');
}

The helpers that use Google Cloud metadata credentials are intended for workloads running on Google Cloud, such as Cloud Run, Compute Engine, and environments with Application Default Credentials.

0
likes
0
points
1.53k
downloads

Publisher

verified publisheransoro.net

Weekly Downloads

Utilities for Dart services running on Google Cloud, including metadata, Secret Manager, Cloud KMS, and Cloud Tasks helpers.

Repository (GitHub)
View/report issues

Topics

#google-cloud #secret-manager #cloud-kms #cloud-tasks

License

unknown (license)

Dependencies

googleapis, googleapis_auth, http

More

Packages that depend on gcputil