Skip to content

Commit

Permalink
add credentialsProvider doc, add volatile (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
crimson-gao authored Dec 5, 2023
1 parent 83bde72 commit 8e55f76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package com.aliyun.openservices.log.common.auth;

public interface CredentialsProvider {
/**
* This method is called everytime AccessKeyId/AccessKeySecret/StsToken is needed by log client,
* the {@link CredentialsProvider} should cache credentials to avoid update credentials too frequently.
* @note This method must be thread safe to avoid data race.
*/
Credentials getCredentials();
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public Credentials getCredentials() {
}


private TemporaryCredentials credentials;
private volatile TemporaryCredentials credentials;
private final CredentialsFetcher fetcher;
}

0 comments on commit 8e55f76

Please # to comment.