Metadata-Version: 2.4
Name: rboto-sts
Version: 0.2.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Framework :: AsyncIO
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Dist: rboto==0.2.0
License-File: LICENSE
Summary: rboto: async-only, typed Python client for AWS STS, powered by Rust. Alpha preview.
Keywords: rboto,aws,sts,asyncio,typing,rust
Home-Page: https://github.com/ferrumio/rboto
Author-email: Leandro Cavalcante Damascena <leandro.damascena@gmail.com>
License-Expression: Apache-2.0
Requires-Python: >=3.12
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/ferrumio/rboto/releases
Project-URL: Documentation, https://ferrumio.github.io/rboto/clients/
Project-URL: Homepage, https://ferrumio.github.io/rboto/
Project-URL: Issues, https://github.com/ferrumio/rboto/issues
Project-URL: Repository, https://github.com/ferrumio/rboto

<!-- Generated by rboto-codegen. Edit the descriptor, template, or example source. -->
# rboto-sts

rboto is an independent project maintained by [Ferrumio](https://github.com/ferrumio).
It is not affiliated with, sponsored by, or endorsed by Amazon Web Services (AWS).

**Preview (Alpha).** rboto is under active development. APIs may change between releases.

rboto provides an **async-only, typed Python client for AWS STS**,
powered by Rust. This package contains `STSClient` and
**11 operations**.

## Installation

Requires Python 3.12 or newer and a native wheel for your Python version and platform.

```bash
python -m pip install "rboto[sts]"
```

You can also install `rboto-sts` directly; it installs the matching
`rboto` package. Only the selected service is installed.

These are the package names to use when a release is available on your package index.
If your index has no release yet, follow the
[source installation instructions](https://ferrumio.github.io/rboto/getting-started/).

## Usage

Configure credentials through your environment, shared profile, or workload role.
The example uses `us-east-1`; select a region where your service and resources are available.
Resource names, identifiers, input files, and model IDs in the example are placeholders
to replace with your own.

```python
import asyncio

from rboto import STSClient


async def main() -> None:
    client = STSClient(region="us-east-1")
    response = await client.get_caller_identity()
    print(response.account)
    print(response.arn)


if __name__ == "__main__":
    asyncio.run(main())
```

In an application with an event loop, call `await main()` instead of `asyncio.run(main())`.
Reuse the client across calls. Constructing a client does not send a request.

## API conventions

- Import the client with `from rboto import STSClient`.
- Every operation is asynchronous: use `await client.method(...)`.
- Operation arguments are keyword-only and use the Python names listed below.
- Structured inputs use typed dictionaries and tagged unions from `rboto_sts.types`.
- Regular responses expose typed attributes; `response.to_dict()` converts them to a dictionary.
- Event-stream responses may be typed dictionaries containing async iterators. Follow the
  declared return type; consume event streams with `async for`.
- Byte streams are consumed asynchronously. `await stream.read()` buffers the complete body;
  iterate the stream when processing a large response.
- Direct operation calls return one page.

- Catch modeled exceptions from `rboto_sts.exceptions`. Their `error_code`,
  `message`, and `operation_name` identify service failures.

Clients also accept `profile`, `endpoint_url`, or shared `Session` settings.
See [configuration](https://ferrumio.github.io/rboto/guides/configuration/),
[errors](https://ferrumio.github.io/rboto/guides/errors/), and
[streaming](https://ferrumio.github.io/rboto/guides/streaming/).

## Operations

The [operation reference](https://ferrumio.github.io/rboto/reference/sts/)
documents arguments, nested types, Output fields, errors and pagination.
Method and type docstrings link to their reference pages.

This is the complete operation catalog for this generated package. “Required arguments”
lists arguments without defaults in the Python signature. Service-side conditions may
require additional arguments. Each method links to its complete signature, including
optional arguments. Nested input definitions are in `rboto_sts.types`;
native response definitions are in the package's `_native.pyi`.

| Method | Required arguments | Return type |
|---|---|---|
| [`assume_role`](#assume_role) | <code>role_arn: str</code>, <code>role_session_name: str</code> | <code>AssumeRoleOutput</code> |
| [`assume_role_with_saml`](#assume_role_with_saml) | <code>role_arn: str</code>, <code>principal_arn: str</code>, <code>saml_assertion: str</code> | <code>AssumeRoleWithSAMLOutput</code> |
| [`assume_role_with_web_identity`](#assume_role_with_web_identity) | <code>role_arn: str</code>, <code>role_session_name: str</code>, <code>web_identity_token: str</code> | <code>AssumeRoleWithWebIdentityOutput</code> |
| [`assume_root`](#assume_root) | <code>target_principal: str</code>, <code>task_policy_arn: PolicyDescriptorType</code> | <code>AssumeRootOutput</code> |
| [`decode_authorization_message`](#decode_authorization_message) | <code>encoded_message: str</code> | <code>DecodeAuthorizationMessageOutput</code> |
| [`get_access_key_info`](#get_access_key_info) | <code>access_key_id: str</code> | <code>GetAccessKeyInfoOutput</code> |
| [`get_caller_identity`](#get_caller_identity) | None | <code>GetCallerIdentityOutput</code> |
| [`get_delegated_access_token`](#get_delegated_access_token) | <code>trade_in_token: str</code> | <code>GetDelegatedAccessTokenOutput</code> |
| [`get_federation_token`](#get_federation_token) | <code>name: str</code> | <code>GetFederationTokenOutput</code> |
| [`get_session_token`](#get_session_token) | None | <code>GetSessionTokenOutput</code> |
| [`get_web_identity_token`](#get_web_identity_token) | <code>audience: Sequence[str]</code>, <code>signing_algorithm: str</code> | <code>GetWebIdentityTokenOutput</code> |

## Complete signatures

### assume_role

```python
async def assume_role(
    *,
    role_arn: str,
    role_session_name: str,
    policy_arns: Sequence[PolicyDescriptorType] | None = None,
    policy: str | None = None,
    duration_seconds: int | None = None,
    tags: Sequence[Tag] | None = None,
    transitive_tag_keys: Sequence[str] | None = None,
    external_id: str | None = None,
    serial_number: str | None = None,
    token_code: str | None = None,
    source_identity: str | None = None,
    provided_contexts: Sequence[ProvidedContext] | None = None,
    minimum_session_token_size: int | None = None,
) -> AssumeRoleOutput: ...
```


### assume_role_with_saml

```python
async def assume_role_with_saml(
    *,
    role_arn: str,
    principal_arn: str,
    saml_assertion: str,
    policy_arns: Sequence[PolicyDescriptorType] | None = None,
    policy: str | None = None,
    duration_seconds: int | None = None,
    minimum_session_token_size: int | None = None,
) -> AssumeRoleWithSAMLOutput: ...
```


### assume_role_with_web_identity

```python
async def assume_role_with_web_identity(
    *,
    role_arn: str,
    role_session_name: str,
    web_identity_token: str,
    provider_id: str | None = None,
    policy_arns: Sequence[PolicyDescriptorType] | None = None,
    policy: str | None = None,
    duration_seconds: int | None = None,
    minimum_session_token_size: int | None = None,
) -> AssumeRoleWithWebIdentityOutput: ...
```


### assume_root

```python
async def assume_root(
    *,
    target_principal: str,
    task_policy_arn: PolicyDescriptorType,
    duration_seconds: int | None = None,
    minimum_session_token_size: int | None = None,
) -> AssumeRootOutput: ...
```


### decode_authorization_message

```python
async def decode_authorization_message(
    *,
    encoded_message: str,
) -> DecodeAuthorizationMessageOutput: ...
```


### get_access_key_info

```python
async def get_access_key_info(
    *,
    access_key_id: str,
) -> GetAccessKeyInfoOutput: ...
```


### get_caller_identity

```python
async def get_caller_identity() -> GetCallerIdentityOutput: ...
```


### get_delegated_access_token

```python
async def get_delegated_access_token(
    *,
    trade_in_token: str,
) -> GetDelegatedAccessTokenOutput: ...
```


### get_federation_token

```python
async def get_federation_token(
    *,
    name: str,
    policy: str | None = None,
    policy_arns: Sequence[PolicyDescriptorType] | None = None,
    duration_seconds: int | None = None,
    tags: Sequence[Tag] | None = None,
    minimum_session_token_size: int | None = None,
) -> GetFederationTokenOutput: ...
```


### get_session_token

```python
async def get_session_token(
    *,
    duration_seconds: int | None = None,
    serial_number: str | None = None,
    token_code: str | None = None,
    minimum_session_token_size: int | None = None,
) -> GetSessionTokenOutput: ...
```


### get_web_identity_token

```python
async def get_web_identity_token(
    *,
    audience: Sequence[str],
    signing_algorithm: str,
    duration_seconds: int | None = None,
    tags: Sequence[Tag] | None = None,
) -> GetWebIdentityTokenOutput: ...
```


## Links

- [Service guide](https://ferrumio.github.io/rboto/clients/)
- [Repository](https://github.com/ferrumio/rboto)
- [Issues](https://github.com/ferrumio/rboto/issues)
- [Releases](https://github.com/ferrumio/rboto/releases)

Licensed under Apache-2.0.

