Skip to content

Commit

Permalink
refactor: update metadata, synth, and deps (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored May 14, 2019
1 parent 9db5710 commit 63f9a15
Show file tree
Hide file tree
Showing 12 changed files with 499 additions and 87 deletions.
15 changes: 0 additions & 15 deletions packages/google-cloud-kms/.cloud-repo-tools.json

This file was deleted.

7 changes: 3 additions & 4 deletions packages/google-cloud-kms/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ out/
build/
system-test/secrets.js
system-test/*key.json
*.lock
**/*.lock
**/package-lock.json
.DS_Store
google-cloud-logging-winston-*.tgz
google-cloud-logging-bunyan-*.tgz
package-lock.json
__pycache__
13 changes: 13 additions & 0 deletions packages/google-cloud-kms/.repo-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "kms",
"name_pretty": "Google Cloud Key Management Service",
"product_documentation": "https://cloud.google.com/kms",
"client_documentation": "https://cloud.google.com/nodejs/docs/reference/kms/latest/",
"issue_tracker": "https://issuetracker.google.com/savedsearches/5264932",
"release_level": "beta",
"language": "nodejs",
"repo": "googleapis/nodejs-kms",
"distribution_name": "@google-cloud/kms",
"api_id": "kms.googleapis.com",
"requires_billing": true
}
100 changes: 70 additions & 30 deletions packages/google-cloud-kms/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,58 @@
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
[//]: # "To regenerate it, use `npm run generate-scaffolding`."
[//]: # "To regenerate it, use `python -m synthtool`."
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>

# [Cloud Key Management Service: Node.js Client](https://github.com/googleapis/nodejs-kms)
# [Google Cloud Key Management Service: Node.js Client](https://github.com/googleapis/nodejs-kms)

[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style&#x3D;flat)](https://cloud.google.com/terms/launch-stages)
[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
[![npm version](https://img.shields.io/npm/v/@google-cloud/kms.svg)](https://www.npmjs.org/package/@google-cloud/kms)
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-kms/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-kms)

[Cloud KMS](https://cloud.google.com/kms/docs/) allows you to keep encryption keys in one central cloud service, for direct use by other cloud resources and applications. With Cloud KMS you are the ultimate custodian of your data, you can manage encryption in the cloud the same way you do on-premises, and you have a provable and monitorable root of trust over your data.


* [Using the client library](#using-the-client-library)

Google Cloud Key Management Service (KMS) API client for Node.js


* [Google Cloud Key Management Service Node.js Client API Reference][client-docs]
* [Google Cloud Key Management Service Documentation][product-docs]
* [github.com/googleapis/nodejs-kms](https://github.com/googleapis/nodejs-kms)

Read more about the client libraries for Cloud APIs, including the older
Google APIs Client Libraries, in [Client Libraries Explained][explained].

[explained]: https://cloud.google.com/apis/docs/client-libraries-explained

**Table of contents:**


* [Quickstart](#quickstart)
* [Before you begin](#before-you-begin)
* [Installing the client library](#installing-the-client-library)
* [Using the client library](#using-the-client-library)
* [Samples](#samples)
* [Versioning](#versioning)
* [Contributing](#contributing)
* [License](#license)

## Using the client library
## Quickstart

1. [Select or create a Cloud Platform project][projects].
### Before you begin

1. [Select or create a Cloud Platform project][projects].
1. [Enable billing for your project][billing].

1. [Enable the Cloud Key Management Service API][enable_api].

1. [Enable the Google Cloud Key Management Service API][enable_api].
1. [Set up authentication with a service account][auth] so you can access the
API from your local workstation.

1. Install the client library:
### Installing the client library

```bash
npm install @google-cloud/kms
```

npm install --save @google-cloud/kms

1. Try an example:
### Using the client library

```javascript
async function quickstart(
Expand All @@ -59,29 +79,60 @@ async function quickstart(
console.log(`No key rings found.`);
}
}

```



## Samples

Samples are in the [`samples/`](https://github.com/googleapis/nodejs-kms/tree/master/samples) directory. The samples' `README.md`
has instructions for running the samples.

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| KMS | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |

The [Cloud KMS Node.js Client API Reference][client-docs] documentation
| Add Member To Crypto Key Policy | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/addMemberToCryptoKeyPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/addMemberToCryptoKeyPolicy.js,samples/README.md) |
| Add Member To Key Ring Policy | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/addMemberToKeyRingPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/addMemberToKeyRingPolicy.js,samples/README.md) |
| Create Crypto Key | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/createCryptoKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/createCryptoKey.js,samples/README.md) |
| Create Crypto Key Version | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/createCryptoKeyVersion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/createCryptoKeyVersion.js,samples/README.md) |
| Create Keyring | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/createKeyring.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/createKeyring.js,samples/README.md) |
| Decrypt | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/decrypt.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/decrypt.js,samples/README.md) |
| Destroy Crypto Key Version | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/destroyCryptoKeyVersion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/destroyCryptoKeyVersion.js,samples/README.md) |
| Disable Crypto Key Version | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/disableCryptoKeyVersion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/disableCryptoKeyVersion.js,samples/README.md) |
| Enable Crypto Key Version | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/enableCryptoKeyVersion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/enableCryptoKeyVersion.js,samples/README.md) |
| Encrypt | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/encrypt.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/encrypt.js,samples/README.md) |
| Get Crypto Key | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/getCryptoKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/getCryptoKey.js,samples/README.md) |
| Get Crypto Key Iam Policy | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/getCryptoKeyIamPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/getCryptoKeyIamPolicy.js,samples/README.md) |
| Get Keyring | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/getKeyring.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/getKeyring.js,samples/README.md) |
| Get Keyring Iam Policy | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/getKeyringIamPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/getKeyringIamPolicy.js,samples/README.md) |
| List Crypto Key Versions | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/listCryptoKeyVersions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/listCryptoKeyVersions.js,samples/README.md) |
| List Crypto Keys | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/listCryptoKeys.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/listCryptoKeys.js,samples/README.md) |
| List Keyrings | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/listKeyrings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/listKeyrings.js,samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
| Remove Member Crypto Key Policy | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/removeMemberCryptoKeyPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/removeMemberCryptoKeyPolicy.js,samples/README.md) |
| Remove Member From Key Ring Policy | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/removeMemberFromKeyRingPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/removeMemberFromKeyRingPolicy.js,samples/README.md) |
| Restore Crypto Key Version | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/restoreCryptoKeyVersion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/restoreCryptoKeyVersion.js,samples/README.md) |
| Set Primary Crypto Key Version | [source code](https://github.com/googleapis/nodejs-kms/blob/master/samples/setPrimaryCryptoKeyVersion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-kms&page=editor&open_in_editor=samples/setPrimaryCryptoKeyVersion.js,samples/README.md) |



The [Google Cloud Key Management Service Node.js Client API Reference][client-docs] documentation
also contains samples.

## Versioning

This library follows [Semantic Versioning](http://semver.org/).



This library is considered to be in **beta**. This means it is expected to be
mostly stable while we work toward a general availability release; however,
complete stability is not guaranteed. We will address issues and requests
against beta libraries with a high priority.




More Information: [Google Cloud Platform Launch Stages][launch_stages]

[launch_stages]: https://cloud.google.com/terms/launch-stages
Expand All @@ -96,21 +147,10 @@ Apache Version 2.0

See [LICENSE](https://github.com/googleapis/nodejs-kms/blob/master/LICENSE)

## What's Next

* [Cloud KMS Documentation][product-docs]
* [Cloud KMS Node.js Client API Reference][client-docs]
* [github.com/googleapis/nodejs-kms](https://github.com/googleapis/nodejs-kms)

Read more about the client libraries for Cloud APIs, including the older
Google APIs Client Libraries, in [Client Libraries Explained][explained].

[explained]: https://cloud.google.com/apis/docs/client-libraries-explained

[client-docs]: https://cloud.google.com/nodejs/docs/reference/kms/latest/
[product-docs]: https://cloud.google.com/kms/docs/
[product-docs]: https://cloud.google.com/kms
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
[projects]: https://console.cloud.google.com/project
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudkms.googleapis.com
[auth]: https://cloud.google.com/docs/authentication/getting-started
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=kms.googleapis.com
[auth]: https://cloud.google.com/docs/authentication/getting-started
14 changes: 4 additions & 10 deletions packages/google-cloud-kms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@
"Google Cloud Key Management Service (KMS) API"
],
"scripts": {
"test": "npm run cover",
"generate-scaffolding": "repo-tools generate all",
"generate-scaffolding-samples": "repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json",
"cover": "nyc --reporter=lcov mocha test/*.js && nyc report",
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
"test-no-cover": "mocha test/ --timeout 600000",
"test": "nyc mocha",
"lint": "eslint '**/*.js'",
"docs": "jsdoc -c .jsdoc.js",
"system-test": "mocha system-test/ smoke-test/ --timeout 600000",
Expand All @@ -47,19 +43,17 @@
"lodash.merge": "^4.6.0"
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "^3.0.0",
"codecov": "^3.0.4",
"eslint": "^5.1.0",
"eslint-config-prettier": "^4.0.0",
"eslint-plugin-node": "^9.0.0",
"eslint-plugin-prettier": "^3.0.0",
"jsdoc": "^3.6.2",
"jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git",
"intelli-espower-loader": "^1.0.1",
"jsdoc": "^3.5.5",
"linkinator": "^1.1.2",
"mocha": "^6.0.0",
"nyc": "^14.0.0",
"power-assert": "^1.6.0",
"prettier": "^1.13.7",
"linkinator": "^1.1.2"
"prettier": "^1.13.7"
}
}
Loading

0 comments on commit 63f9a15

Please sign in to comment.