-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EnvVar AZURE_AUTHORITY_HOST #9324
Closed
Closed
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
b5f7596
Make azure resource creation can be disabled. (#7335)
mitchdenny a781f99
Keyvault ARM template for live test (#7340)
hemanttanwar a68aca1
Fix dyanmic resource deprovision (#7343)
danieljurek 0213d7c
Update README.md
weshaggard dd6c261
Remove OpenCensus tracing support for Java SDKs (#7167)
samvaity 574f7bc
port https://github.com/Azure/azure-sdk-for-java/pull/6835 from v4 (#…
moderakh 409efc5
Return empty string on empty content response from backend (#7347)
kushagraThapar 14c8c1d
Added missing variables from ARM deployment, fixed expected environme…
alzimmermsft 10e4bd5
Initial commit to add API to retrieve min throughput for a CosmosCont…
abinav2307 0c76069
Support AM/PM in MSI token (#7356)
jianghaolu 7a16996
Encryption client from regular client (#7242)
gapra-msft 72f8152
Jan Release readme fix/ changes (#7395)
hemanttanwar eaad511
Post release version update (#7399)
kushagraThapar 8c44c17
Update identity to 1.0.3 (#7398)
jianghaolu 7d14750
Move cosmosdb to cosmos (#7384)
mitchdenny 585add2
Disabld feature CI trigger. (#7363)
mitchdenny 105660c
Update documentation and in-memory checkpoint store sample (#7389)
srnagar e9e5e53
Prep for doc warden updates (#7405)
chidozieononiwu 9def363
Post identity 1.0.3 release version update (#7407)
jianghaolu 379dddf
Continue to use same .receive() method on disconnection (#7336)
conniey f93ec77
Updated storage versions post January release (#7397)
gapra-msft 48171b1
Fixed retry logic on writes on forbidden status (#7402)
kushagraThapar 0f27ea7
Add az namespace span attribute for App config (#7097)
samvaity 3670d35
[After MSAL 1.3] Pluggable HTTP in identity/msal (#7120)
jianghaolu 5b62f09
[After Jan 7] Removing dependency on java.desktop module. (#6877)
JonathanGiles d68f40b
Lower branch coverage threshold for Identity (#7433)
srnagar 572a47a
Update Download To File Write Logic (#7403)
alzimmermsft f819bb4
Updated release version to 3.6.0 (#7428)
kushagraThapar 7232b92
Feature/release verify (#7386)
JimSuplizio a5aba4c
revert license changes (#7387)
sima-zhu 44cc9c4
Update TextSentimentClass to extend ExpandableStringEnum (#7427)
samvaity 74f58ab
Added an overload for listing with a continuation token (#7388)
gapra-msft 62ceaf6
Added ability to create service clients anonymously (#7421)
gapra-msft ee1925d
Fixed upload from file using FluxUtil.write in a manner where the und…
alzimmermsft b89d97c
Added client side checks for account set props (#7426)
gapra-msft cc9158a
Post release version update to 3.7.0-beta.1 (#7478)
kushagraThapar 481cf3b
fixes some bugs and add tests to improve code coveragwe (#7401)
mssfang 3e65a46
Updated Readme and changelog for storage release (#7484)
gapra-msft bbeeed3
Placeholder pipeline for aggregate report generation. (#7486)
mitchdenny 274ae66
Move aggregate reports up.: (#7487)
mitchdenny 6b2c11e
Implements a slf4j logger impl as default logger in azure core (#7298)
sima-zhu 9b198d6
Replace AutoCloseable with reactor's Disposable. Retry and timeout fi…
conniey fb3937a
Eventhubs ARM template for live test (#7344)
hemanttanwar 3c3900a
Fix cancellation handling (#7430)
mitchdenny fc90101
add build qualifier to unreleased version (#7501)
JimSuplizio a18cd1a
Retry network operations in resources scripts (#7510)
heaths 9ef4b0d
Fix up SDKType parameter condition. (#7512)
mitchdenny 570f57f
Paged Flux abstractions (#6465)
anuchandy 6b58732
Clears closed/errored sessions and links (#7534)
conniey f6b17a9
add support for AuthFileCredential
Luyunmt ddf0754
change comments in AuthFileCredentialBuilder.java
Luyunmt bec2c22
change exception,add test and move method ensurecredential
e923537
change extends and change exception
74799df
remove method ensurecredential
Luyunmt f7bb92a
move ensurecredential to gettoken
Luyunmt b0a7bcd
add synchronize and update code format
Luyunmt 6fedf1d
change test and field
Luyunmt 210fa43
add String constant
Luyunmt 6cf7679
add authfilecredential into environmentcredential
Luyunmt 9cbbb8c
add environment variable authorityhost
Luyunmt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,14 +14,28 @@ | |
import reactor.core.publisher.Mono; | ||
|
||
/** | ||
* A credential provider that provides token credentials based on environment variables. The environment variables | ||
* A credential provider that provides token credentials based on environment variables. The sets of environment variables | ||
* expected are: | ||
* <p> | ||
* <ul> | ||
* <li>{@link Configuration#PROPERTY_AZURE_CLIENT_ID AZURE_CLIENT_ID}</li> | ||
* <li>{@link Configuration#PROPERTY_AZURE_CLIENT_SECRET AZURE_CLIENT_SECRET}</li> | ||
* <li>{@link Configuration#PROPERTY_AZURE_TENANT_ID AZURE_TENANT_ID}</li> | ||
* </ul> | ||
* or: | ||
* <p> | ||
* <ul> | ||
* <li>{@link Configuration#PROPERTY_AZURE_CLIENT_ID AZURE_CLIENT_ID}</li> | ||
* <li>{@link Configuration#PROPERTY_AZURE_CLIENT_CERTIFICATE_PATH AZURE_CLIENT_CERTIFICATE_PATH}</li> | ||
* <li>{@link Configuration#PROPERTY_AZURE_TENANT_ID AZURE_TENANT_ID}</li> | ||
* </ul> | ||
* or: | ||
* <p> | ||
* <ul> | ||
* <li>{@link Configuration#PROPERTY_AZURE_CLIENT_ID AZURE_CLIENT_ID}</li> | ||
* <li>{@link Configuration#PROPERTY_AZURE_USERNAME AZURE_USERNAME}</li> | ||
* <li>{@link Configuration#PROPERTY_AZURE_PASSWORD AZURE_PASSWORD}</li> | ||
* </ul> | ||
*/ | ||
@Immutable | ||
public class EnvironmentCredential implements TokenCredential { | ||
|
@@ -41,15 +55,22 @@ public class EnvironmentCredential implements TokenCredential { | |
|
||
@Override | ||
public Mono<AccessToken> getToken(TokenRequestContext request) { | ||
String clientId = configuration.get(Configuration.PROPERTY_AZURE_CLIENT_ID); | ||
String tenantId = configuration.get(Configuration.PROPERTY_AZURE_TENANT_ID); | ||
String clientSecret = configuration.get(Configuration.PROPERTY_AZURE_CLIENT_SECRET); | ||
String certPath = configuration.get(Configuration.PROPERTY_AZURE_CLIENT_CERTIFICATE_PATH); | ||
String username = configuration.get(Configuration.PROPERTY_AZURE_USERNAME); | ||
String password = configuration.get(Configuration.PROPERTY_AZURE_PASSWORD); | ||
Comment on lines
+58
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason these have to be initialized synchronously? |
||
return Mono.fromSupplier(() -> { | ||
if (configuration.contains(Configuration.PROPERTY_AZURE_CLIENT_ID) | ||
&& configuration.contains(Configuration.PROPERTY_AZURE_CLIENT_SECRET) | ||
&& configuration.contains(Configuration.PROPERTY_AZURE_TENANT_ID)) { | ||
// TODO: support other clouds | ||
return new ClientSecretCredential(configuration.get(Configuration.PROPERTY_AZURE_TENANT_ID), | ||
configuration.get(Configuration.PROPERTY_AZURE_CLIENT_ID), | ||
configuration.get(Configuration.PROPERTY_AZURE_CLIENT_SECRET), | ||
identityClientOptions); | ||
if (verifyNotNull(clientId)) { | ||
if (verifyNotNull(tenantId, clientSecret)) { | ||
// TODO: support other clouds | ||
return new ClientSecretCredential(tenantId, clientId, clientSecret, identityClientOptions); | ||
} else if (verifyNotNull(tenantId, certPath)) { | ||
return new ClientCertificateCredential(tenantId, clientId, certPath, null, identityClientOptions); | ||
} else if (verifyNotNull(username, password)) { | ||
return new UsernamePasswordCredential(clientId, tenantId, username, password, identityClientOptions); | ||
} | ||
} | ||
|
||
// Other environment variables | ||
|
@@ -58,4 +79,13 @@ public Mono<AccessToken> getToken(TokenRequestContext request) { | |
null)); | ||
}).flatMap(cred -> cred.getToken(request)); | ||
} | ||
|
||
private boolean verifyNotNull(String... configs){ | ||
for(String config: configs){ | ||
if(config == null){ | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing/renaming a public env variable that is already released is considered a breaking change. Can this env var be retained and
PROPERTY_AZURE_AUTHORITY_HOST
be added as a new env var?