All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.davidmoten.aws.lw.client.Credentials Maven / Gradle / Ivy

Go to download

Lightweight client for all AWS services (but still with useful builders and XML parser)

The newest version!
package com.github.davidmoten.aws.lw.client;

import java.util.Optional;

import com.github.davidmoten.aws.lw.client.internal.CredentialsImpl;
import com.github.davidmoten.aws.lw.client.internal.Environment;

public interface Credentials {
    
    String accessKey();

    String secretKey();

    Optional sessionToken();

    static Credentials of(String accessKey, String secretKey) {
        return new CredentialsImpl(accessKey, secretKey, Optional.empty());
    }
    
    static Credentials of(String accessKey, String secretKey, String sessionToken) {
        return new CredentialsImpl(accessKey, secretKey, Optional.of(sessionToken));
    }

    static Credentials fromEnvironment() {
        return Environment.instance().credentials();
    }
    
    static Credentials fromSystemProperties() {
        return new CredentialsImpl(System.getProperty("aws.accessKeyId"),
                System.getProperty("aws.secretKey"),
                Optional.empty());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy