Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit 333682e

Browse files
committed
add secret manager sample
1 parent 3417f02 commit 333682e

File tree

11 files changed

+527
-0
lines changed

11 files changed

+527
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file specifies files that are *not* uploaded to Google Cloud Platform
2+
# using gcloud. It follows the same syntax as .gitignore, with the addition of
3+
# "#!include" directives (which insert the entries of the given .gitignore-style
4+
# file at that point).
5+
#
6+
# For more information, run:
7+
# $ gcloud topic gcloudignore
8+
#
9+
.gcloudignore
10+
# If you would like to upload your .git directory, .gitignore file or files
11+
# from your .gitignore file, remove the corresponding line
12+
# below:
13+
.git
14+
.gitignore
15+
16+
node_modules
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const { SecretManagerServiceClient } = require('@google-cloud/secret-manager');
2+
3+
const secretManagerServiceClient = new SecretManagerServiceClient();
4+
const name = 'projects/shadowsocks-218808/secrets/workflow/versions/latest';
5+
6+
exports.testSecretManager = async (req, res) => {
7+
const [version] = await secretManagerServiceClient.accessSecretVersion({ name });
8+
const payload = version.payload.data.toString();
9+
console.debug(`Payload: ${payload}`);
10+
res.sendStatus(200);
11+
};

0 commit comments

Comments
 (0)