GithubHelp home page GithubHelp logo

vladvasiliu / aws-sdk-sts-caching-provider Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 14 KB

Caching STS credentials provider for aws-sdk-rust

License: Apache License 2.0

Rust 100.00%
aws aws-sdk-rust iam sts aws-sts rust-library

aws-sdk-sts-caching-provider's Introduction

aws-sdk-sts-caching-provider

This is a credential provider for use with aws-sdk-rust. It sources the credentials from STS and caches them.

Status

This project is in its early stages, but should be usable. It will probably be replaced by functionality in the AWS SDK itself at some point.

Usage

Reference the library in your Cargo.toml:

[dependencies]
aws-sdk-sts-caching-provider = { git = "https://github.com/vladvasiliu/aws-sdk-sts-caching-provider.git" }

In your code:

use aws_sdk_sts_caching_provider::STSCredentialsProvider;

async fn work() {
    let credential_provider = STSCredentialsProvider::new(
        role_arn,
        Some("external_id"),
        Some("source_identity"),
        Some("session_name"),
        Some(3600),                 // Session duration
        60,                         // Minimum remaining lifetime of the token before refresh
    );
    
    let config = aws_config::from_env().credentials_provider(credential_provider).load().await;
    let client = aws_sdk_health::client::Client::new(&config);
    client.do_something();
}

Legal

The code is released under the terms of the Apache 2.0 License, which can be read in LICENSE.

This project is in no way affiliated with AWS or the AWS SDK project.

aws-sdk-sts-caching-provider's People

Contributors

vladvasiliu avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.