/** * @see #builder() */ private StsAssumeRoleWithSamlCredentialsProvider(Builder builder) { super(builder, "sts-assume-role-with-saml-credentials-provider"); Validate.notNull(builder.assumeRoleWithSamlRequestSupplier, "Assume role with SAML request must not be null."); this.assumeRoleWithSamlRequestSupplier = builder.assumeRoleWithSamlRequestSupplier; }
ApacheHttpClient(ConnectionManagerAwareHttpClient httpClient, ApacheHttpRequestConfig requestConfig, AttributeMap resolvedOptions) { this.httpClient = notNull(httpClient, "httpClient must not be null."); this.requestConfig = notNull(requestConfig, "requestConfig must not be null."); this.resolvedOptions = notNull(resolvedOptions, "resolvedOptions must not be null"); }
/** * @see #builder() */ private StsAssumeRoleCredentialsProvider(Builder builder) { super(builder, "sts-assume-role-credentials-provider"); Validate.notNull(builder.assumeRoleRequestSupplier, "Assume role request must not be null."); this.assumeRoleRequestSupplier = builder.assumeRoleRequestSupplier; }
/** * @see #builder() */ private StsGetFederationTokenCredentialsProvider(Builder builder) { super(builder, "sts-get-federation-token-credentials-provider"); Validate.notNull(builder.getFederationTokenRequest, "Get session token request must not be null."); this.getFederationTokenRequest = builder.getFederationTokenRequest; }
/** * @see #builder() */ private StsGetSessionTokenCredentialsProvider(Builder builder) { super(builder, "sts-get-token-credentials-provider"); Validate.notNull(builder.getSessionTokenRequest, "Get session token request must not be null."); this.getSessionTokenRequest = builder.getSessionTokenRequest; }
/** * @see #builder() */ private StsAssumeRoleWithWebIdentityCredentialsProvider(Builder builder) { super(builder, "sts-assume-role-with-web-identity-credentials-provider"); Validate.notNull(builder.assumeRoleWithWebIdentityRequest, "Assume role with web identity request must not be null."); this.assumeRoleWithWebIdentityRequest = builder.assumeRoleWithWebIdentityRequest; }
/** * @see #builder() */ private StsAssumeRoleWithSamlCredentialsProvider(Builder builder) { super(builder, "sts-assume-role-with-saml-credentials-provider"); Validate.notNull(builder.assumeRoleWithSamlRequestSupplier, "Assume role with SAML request must not be null."); this.assumeRoleWithSamlRequestSupplier = builder.assumeRoleWithSamlRequestSupplier; }
/** * Validate that the customer set the provided field. */ protected static <U> U require(String field, U required) { return Validate.notNull(required, "The '%s' must be configured in the client builder.", field); } }
/** * @see #builder() */ private StsAssumeRoleWithWebIdentityCredentialsProvider(Builder builder) { super(builder, "sts-assume-role-with-web-identity-credentials-provider"); Validate.notNull(builder.assumeRoleWithWebIdentityRequest, "Assume role with web identity request must not be null."); this.assumeRoleWithWebIdentityRequest = builder.assumeRoleWithWebIdentityRequest; }
private StaticCredentialsProvider(AwsCredentials credentials) { this.credentials = Validate.notNull(credentials, "Credentials must not be null."); }
/** * Add a mapping between the provided key and value. */ public <T> Builder put(Key<T> key, T value) { Validate.notNull(key, "Key to set must not be null."); configuration.put(key, value); return this; }
/** * Add a mapping between the provided key and value. */ public <T> Builder put(Key<T> key, T value) { Validate.notNull(key, "Key to set must not be null."); configuration.put(key, value); return this; }
private AwsBasicCredentials(String accessKeyId, String secretAccessKey, boolean validateCredentials) { this.accessKeyId = trimToNull(accessKeyId); this.secretAccessKey = trimToNull(secretAccessKey); if (validateCredentials) { Validate.notNull(this.accessKeyId, "Access key ID cannot be blank."); Validate.notNull(this.secretAccessKey, "Secret access key cannot be blank."); } }
/** * Get the value associated with the provided key from this map. This will return null if the value is not set or if the * value * stored is null. These cases can be disambiguated using {@link #containsKey(Key)}. */ public <T> T get(Key<T> key) { Validate.notNull(key, "Key to retrieve must not be null."); return key.convertValue(attributes.get(key)); }
/** * Get the value associated with the provided key from this map. This will return null if the value is not set or if the * value * stored is null. These cases can be disambiguated using {@link #containsKey(Key)}. */ public <T> T get(Key<T> key) { Validate.notNull(key, "Key to retrieve must not be null."); return key.convertValue(attributes.get(key)); }
@Override protected Credentials getUpdatedCredentials(StsClient stsClient) { AssumeRoleRequest assumeRoleRequest = assumeRoleRequestSupplier.get(); Validate.notNull(assumeRoleRequest, "Assume role request must not be null."); return stsClient.assumeRole(assumeRoleRequest).credentials(); }
@Override protected Credentials getUpdatedCredentials(StsClient stsClient) { AssumeRoleWithSamlRequest assumeRoleWithSamlRequest = assumeRoleWithSamlRequestSupplier.get(); Validate.notNull(assumeRoleWithSamlRequest, "Assume role with saml request must not be null."); return stsClient.assumeRoleWithSAML(assumeRoleWithSamlRequest).credentials(); }
@Override protected Credentials getUpdatedCredentials(StsClient stsClient) { AssumeRoleRequest assumeRoleRequest = assumeRoleRequestSupplier.get(); Validate.notNull(assumeRoleRequest, "Assume role request must not be null."); return stsClient.assumeRole(assumeRoleRequest).credentials(); }
protected StsCredentialsProvider(BaseBuilder<?, ?> builder, String asyncThreadName) { this.stsClient = Validate.notNull(builder.stsClient, "STS client must not be null."); CachedSupplier.Builder<SessionCredentialsHolder> cacheBuilder = CachedSupplier.builder(this::updateSessionCredentials); if (builder.asyncCredentialUpdateEnabled) { cacheBuilder.prefetchStrategy(new NonBlocking(asyncThreadName)); } this.sessionCache = cacheBuilder.build(); }
protected StsCredentialsProvider(BaseBuilder<?, ?> builder, String asyncThreadName) { this.stsClient = Validate.notNull(builder.stsClient, "STS client must not be null."); CachedSupplier.Builder<SessionCredentialsHolder> cacheBuilder = CachedSupplier.builder(this::updateSessionCredentials); if (builder.asyncCredentialUpdateEnabled) { cacheBuilder.prefetchStrategy(new NonBlocking(asyncThreadName)); } this.sessionCache = cacheBuilder.build(); }