Metadata-Version: 2.1
Name: keyrings.codeartifact
Version: 1.2.1
Summary: Automatically retrieve credentials for AWS CodeArtifact.
Author-email: "Joshua M. Keyes" <joshua.michael.keyes@gmail.com>
License: MIT License
        
        Copyright (c) 2022 Joshua M. Keyes <joshua.michael.keyes@gmail.com>
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/jmkeyes/keyrings.codeartifact
Project-URL: Issues, https://github.com/jmkeyes/keyrings.codeartifact/issues
Project-URL: Repository, https://github.com/jmkeyes/keyrings.codeartifact.git
Keywords: aws,codeartifact,keyring
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.8.0
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: keyring
Requires-Dist: boto3
Provides-Extra: devel
Requires-Dist: flake8 ; extra == 'devel'
Requires-Dist: black ; extra == 'devel'
Provides-Extra: testing
Requires-Dist: pytest >=6 ; extra == 'testing'
Requires-Dist: pytest-cov ; extra == 'testing'

AWS CodeArtifact Keyring Backend
================================

The `keyrings.codeartifact` package provides authentication for publishing and consuming packages within a private
PyPi repository hosted on [AWS CodeArtifact](https://aws.amazon.com/codeartifact/); it contains an extension to the
[keyring](https://pypi.org/project/keyring/) library that will automatically inject a time-limited access token.

Installation
------------
To install this package, install the "keyrings.codeartifact" package using `pip`:

```
pip install keyrings.codeartifact
```

Usage
-----
The `keyring` library has been integrated with recent versions of pip and twine. Once installed, this library will
automatically supply credentials whenever pip/twine (or other keyring-enabled package) attempts to use a repository
hosted within CodeArtifact. It will use any appropriate AWS credentials provided in `~/.aws/credentials` by default.

```
--index-url https://${DOMAIN}-${ACCOUNT}.d.codeartifact.${REGION}.amazonaws.com/pypi/${REPOSITORY}/simple/
```

Config
------
This backend provides a number of configuration options to modify the behaviour of the AWS client.

These configuration options can be specified within a `[codeartifact]` section of the `keyringrc.cfg`.

Run `keyring diagnose` to find its as the location; it varies between different platforms.

Available options:

  - `profile_name`: Use a specific AWS profile to authenticate with AWS.
  - `token_duration`: Validity period (in seconds) for retieved authorization tokens.
  - `aws_access_key_id`: Use a specific AWS access key to authenticate with AWS.
  - `aws_secret_access_key`: Use a specific AWS secret access key to authenticate with AWS.

For more explanation of these options see the [AWS CLI documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html).

An example `keyringrc.cfg` section:

```ini
[codeartifact]
# Tokens should only be valid for 30 minutes.
token_duration=1800

# Use the 'default' profile name.
profile_name=default

# Use the following access keys.
aws_access_key_id=xxxxxxxxx
aws_secret_access_key=xxxxxxxxx
```
