in src/main/java/com/aliyun/credentials/provider/OIDCRoleArnCredentialProvider.java [76:102]
public OIDCRoleArnCredentialProvider(String roleArn, String oidcProviderArn, String oidcTokenFilePath) {
super(new BuilderImpl());
if (!StringUtils.isEmpty(roleArn)) {
this.roleArn = roleArn;
} else if (!StringUtils.isEmpty(AuthUtils.getEnvironmentRoleArn())) {
this.roleArn = AuthUtils.getEnvironmentRoleArn();
} else {
throw new CredentialException("roleArn does not exist and env ALIBABA_CLOUD_ROLE_ARN is null.");
}
if (!StringUtils.isEmpty(oidcProviderArn)) {
this.oidcProviderArn = oidcProviderArn;
} else if (!StringUtils.isEmpty(AuthUtils.getEnvironmentOIDCProviderArn())) {
this.oidcProviderArn = AuthUtils.getEnvironmentOIDCProviderArn();
} else {
throw new CredentialException("OIDCProviderArn does not exist and env ALIBABA_CLOUD_OIDC_PROVIDER_ARN is null.");
}
if (!StringUtils.isEmpty(oidcTokenFilePath)) {
this.oidcTokenFilePath = oidcTokenFilePath;
} else if (!StringUtils.isEmpty(AuthUtils.getEnvironmentOIDCTokenFilePath())) {
this.oidcTokenFilePath = AuthUtils.getEnvironmentOIDCTokenFilePath();
} else {
throw new CredentialException("OIDCTokenFilePath does not exist and env ALIBABA_CLOUD_OIDC_TOKEN_FILE is null.");
}
if (!StringUtils.isEmpty(AuthUtils.getEnvironmentRoleSessionName())) {
this.roleSessionName = AuthUtils.getEnvironmentRoleSessionName();
}
}