Skip to content

Update SDK with latest APIs #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/create-release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: v0.0.${{ github.run_number }}
release_name: Release v0.0.${{ github.run_number }}
tag_name: v0.1.${{ github.run_number }}
release_name: Release v0.1.${{ github.run_number }}
body: |
${{ steps.Changelog.outputs.changelog }}
draft: false
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,6 @@ dmypy.json

# Pyre type checker
.pyre/
*.idea
*.idea
.openapi-generator-ignore
.openapi-generator
64 changes: 25 additions & 39 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making
participation in our project and our community a harassment-free experience for everyone, regardless of age, body size,
disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education,
socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:
Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
Expand All @@ -22,53 +19,42 @@ include:

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take
appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any
contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the
project or its community. Examples of representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed representative at an online or offline
event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at
[email protected]. All complaints will be reviewed and investigated and will result in a response that is deemed
necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to
the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent
repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available
at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

Expand Down
17 changes: 12 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,23 @@ Review the following guidelines for submitting questions, issues, or changes to

## Questions

If you have questions about using the IBM Cloud Secrets Manager SDKs, you can ask questions in
[Stack Overflow](https://stackoverflow.com/questions/tagged/ibm-cloud+secrets-manager). Be sure to include the `ibm-cloud` and `secrets-manager` tags.
If you have questions about using the IBM Cloud Secrets Manager SDKs, you can ask questions in
[Stack Overflow](https://stackoverflow.com/questions/tagged/ibm-cloud+secrets-manager). Be sure to include
the `ibm-cloud` and `secrets-manager` tags.

You can also check out the [Secrets Manager documentation](https://cloud.ibm.com/docs/secrets-manager) and [API reference](https://cloud.ibm.com/apidocs/secrets-manager) for more information about the service.
You can also check out the [Secrets Manager documentation](https://cloud.ibm.com/docs/secrets-manager)
and [API reference](https://cloud.ibm.com/apidocs/secrets-manager) for more information about the service.

## Issues

If you encounter an issue with this project, you're welcome to submit a [bug report](https://github.com/IBM/secrets-manager-python-sdk/issues) to help us improve. Before you create a new issue, please search for similar issues in case someone has already reported the same problem.
If you encounter an issue with this project, you're welcome to submit
a [bug report](https://github.com/IBM/secrets-manager-python-sdk/issues) to help us improve. Before you create a new
issue, please search for similar issues in case someone has already reported the same problem.

## Changes

Thank you for contributing to IBM Cloud SDK projects! To learn more about submitting changes to this repository, check out the [IBM Cloud SDK Common contribution guidelines](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/CONTRIBUTING_python.md).
Thank you for contributing to IBM Cloud SDK projects! To learn more about submitting changes to this repository, check
out
the [IBM Cloud SDK Common contribution guidelines](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/CONTRIBUTING_python.md)
.

47 changes: 31 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# IBM Cloud Secrets Manager Python SDK

A Python client library to interact with the [IBM Cloud® Secrets Manager APIs](https://cloud.ibm.com/apidocs/secrets-manager).
A Python client library to interact with
the [IBM Cloud® Secrets Manager APIs](https://cloud.ibm.com/apidocs/secrets-manager).

<details>
<summary>Table of Contents</summary>
Expand All @@ -14,21 +15,23 @@ A Python client library to interact with the [IBM Cloud® Secrets Manager APIs](
* [Issues](#issues)
* [Contributing](#contributing)
* [License](#license)

</details>

## Overview

The IBM Cloud Secrets Manager Python SDK allows developers to programmatically interact with the following IBM Cloud services:
The IBM Cloud Secrets Manager Python SDK allows developers to programmatically interact with the following IBM Cloud
services:

Service name | Imported class name
--- | ---
[Secrets Manager](https://cloud.ibm.com/apidocs/secrets-manager) | IbmCloudSecretsManagerApiV1
[Secrets Manager](https://cloud.ibm.com/apidocs/secrets-manager) | SecretsManagerV1

## Prerequisites

- An [IBM Cloud account](https://cloud.ibm.com/registration).
- A [Secrets Manager service instance](https://cloud.ibm.com/catalog/services/secrets-manager).
- An [IBM Cloud API key](https://cloud.ibm.com/iam/apikeys) that allows the SDK to access your account.
- An [IBM Cloud API key](https://cloud.ibm.com/iam/apikeys) that allows the SDK to access your account.
- Python 3.5.3 or above.

## Installation
Expand All @@ -49,9 +52,13 @@ easy_install --upgrade "ibm-secrets-manager-sdk"

Secrets Manager uses token-based Identity and Access Management (IAM) authentication.

With IAM authentication, you supply an API key that is used to generate an access token. Then, the access token is included in each API request to Secrets Manager. Access tokens are valid for a limited amount of time and must be regenerated.
With IAM authentication, you supply an API key that is used to generate an access token. Then, the access token is
included in each API request to Secrets Manager. Access tokens are valid for a limited amount of time and must be
regenerated.

Authentication for this SDK is accomplished by using [IAM authenticators](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md#authentication). Import authenticators from `ibm_cloud_sdk_core.authenticators`.
Authentication for this SDK is accomplished by
using [IAM authenticators](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md#authentication). Import
authenticators from `ibm_cloud_sdk_core.authenticators`.

### Examples

Expand All @@ -60,18 +67,20 @@ Authentication for this SDK is accomplished by using [IAM authenticators](https:
```python
from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator

secretsManager = IbmCloudSecretsManagerApiV1(
secretsManager = SecretsManagerV1(
authenticator=IAMAuthenticator(apikey='<IBM_CLOUD_API_KEY>')
)
```

To learn more about IAM authenticators and how to use them in your Python application, see the [IBM Python SDK Core documentation](https://github.com/IBM/python-sdk-core/blob/master/Authentication.md).
To learn more about IAM authenticators and how to use them in your Python application, see
the [IBM Python SDK Core documentation](https://github.com/IBM/python-sdk-core/blob/master/Authentication.md).

## Using the SDK

### Basic usage

- Use the `set_service_url` method to set the endpoint URL that is specific to your Secrets Manager service instance. To find your endpoint URL, you can copy it from the **Endpoints** page in the Secrets Manager UI.
- Use the `set_service_url` method to set the endpoint URL that is specific to your Secrets Manager service instance. To
find your endpoint URL, you can copy it from the **Endpoints** page in the Secrets Manager UI.

#### Examples

Expand All @@ -81,9 +90,9 @@ Here's an example `secrets_manager.py` file:

```python
from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
from ibm_secrets_manager_sdk.ibm_cloud_secrets_manager_api_v1 import *
from ibm_secrets_manager_sdk.secrets_manager_v1 import *

secretsManager = IbmCloudSecretsManagerApiV1(
secretsManager = SecretsManagerV1(
authenticator=IAMAuthenticator(apikey='<IBM_CLOUD_API_KEY>')
)

Expand All @@ -110,19 +119,25 @@ print('The arbitrary secret payload is: ' + secretPayload)

```

Replace the `apikey` and `set_service_url()` values. Then use the `python secrets_manager.py` command to run your application. You should see the payload of the arbitrary secret that was created.
Replace the `apikey` and `set_service_url()` values. Then use the `python secrets_manager.py` command to run your
application. You should see the payload of the arbitrary secret that was created.

For more information and IBM Cloud SDK usage examples for Python, see the [IBM Cloud SDK Common documentation](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md).
For more information and IBM Cloud SDK usage examples for Python, see
the [IBM Cloud SDK Common documentation](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md).

## Questions

If you're having difficulties using this SDK, you can ask questions about this project by using [Stack Overflow](https://stackoverflow.com/questions/tagged/ibm-cloud+secrets-manager). Be sure to include the `ibm-cloud` and `secrets-manager` tags.
If you're having difficulties using this SDK, you can ask questions about this project by
using [Stack Overflow](https://stackoverflow.com/questions/tagged/ibm-cloud+secrets-manager). Be sure to include
the `ibm-cloud` and `secrets-manager` tags.

You can also check out the [Secrets Manager documentation](https://cloud.ibm.com/docs/secrets-manager) and [API reference](https://cloud.ibm.com/apidocs/secrets-manager) for more information about the service.
You can also check out the [Secrets Manager documentation](https://cloud.ibm.com/docs/secrets-manager)
and [API reference](https://cloud.ibm.com/apidocs/secrets-manager) for more information about the service.

## Issues

If you encounter an issue with the project, you're welcome to submit a [bug report](https://github.com/IBM/secrets-manager-python-sdk/issues) to help us improve.
If you encounter an issue with the project, you're welcome to submit
a [bug report](https://github.com/IBM/secrets-manager-python-sdk/issues) to help us improve.

## Contributing

Expand Down
Loading