Commit Graph

324 Commits

Author SHA1 Message Date
Anton Kolesnyk
237e617a4a
Identity: Log Client ID used in ManagedIdentityCredential (#6426)
* Identity: Log Client ID used in ManagedIdentityCredential

* Clang-format

* [&]

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2025-02-24 12:27:33 -08:00
Anton Kolesnyk
d96cd6b76a
Identity: disable GCC warning (#6414)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2025-02-13 16:19:46 -08:00
Anton Kolesnyk
b40045e8e9
Identity: Add AzureCliCredentialOptions::Subscription (#6415)
* Identity: Add AzureCliCredentialOptions::Subscription

* Clang-format

* Id => ID

* Fix typo

* Apply suggestions from code review

Co-authored-by: Larry Osterman <LarryOsterman@users.noreply.github.com>

* Replace `decltype` with `auto` in test file

* + "If this is the name of a subscription, use its ID instead."

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
Co-authored-by: Larry Osterman <LarryOsterman@users.noreply.github.com>
2025-02-13 15:26:10 -08:00
Ronnie Geraghty
049b7a6fe6
added missing link to identity readme (#6310)
The Identity README was missing the link for the Azure subscription trial
2024-12-20 13:36:43 -08:00
Anton Kolesnyk
bef420162e
Fix typos (#6234)
* Fix typos

* Fix name collision

* Re-trigger CI

* Re-trigger CI

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2024-11-17 23:06:28 -08:00
Anton Kolesnyk
b74d9c36be
Minor code cleanups (3) (#6179)
* Minor code cleanups (3)

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2024-11-11 15:36:58 -08:00
Azure SDK Bot
3ca9fe5540
Increment package version after release of azure-identity (#6197) 2024-11-08 20:09:44 +00:00
Ahson Khan
c7d19e2832
Prepare for Identity Nov GA patch release. (#6194) 2024-11-08 10:40:52 -08:00
Ahson Khan
ac3321c857
Fix overflow issue in token cache. (#6190)
* Fix overflow issue in token cache.

* Add test
2024-11-06 18:32:09 -08:00
Anton Kolesnyk
868a14f4d8
Minor code cleanups 2 (#6171)
* Minor code cleanups

* Clang-format

* Adjust line coverage target

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2024-11-05 10:12:13 -08:00
Anton Kolesnyk
e1d9893467
Acknowledge community contribution to Identity (#6092)
* Acknowledge community contribution to Identity

* Update cspell.json

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2024-10-11 21:28:34 +00:00
James Le Cuirot
a091f4c8e0
Set VERSION property against all libraries to write versioned SONAME (#6087)
The SONAME currently written to shared libraries is unversioned, e.g.
libazure-core.so. The SDK's ABI is unstable, so replacing these .so
files with newer versions will immediately break any consumers.

Setting the VERSION property results in libazure-core.so being a symlink
that is used at build time to point to the versioned library, e.g.
libazure-core.so.1.14.0. Consumers point directly to the versioned
library and continue to work against the older version when the library
is upgraded. Once rebuilt, they then point to the newer version instead.

It is more common to use an ABI version that is separate to the library
version, but it makes sense to use the latter when the ABI is unstable.
The Boost libraries do exactly this.

This change has no effect on static libraries, which is the more common
use case. See the CMake documentation for its wider effects.

https://cmake.org/cmake/help/latest/prop_tgt/VERSION.html
2024-10-11 11:42:13 -07:00
John Blischak
7f8647a33d
azure-identity-cpp 1.10.0 requires azure-core-cpp >= 1.14.0 (#6086) 2024-10-09 09:51:21 -07:00
Azure SDK Bot
8abdba048f
Increment package version after release of azure-identity (#6080) 2024-10-08 14:18:11 -07:00
Ahson Khan
29bbab9747
Azure Identity October GA Release (#6057)
* Azure Identity October GA Release

* Update CL entry to include resource ID feature.
2024-10-08 11:00:03 -07:00
Ahson Khan
f80caf2fea
Remove support for customizing the IMDS endpoint within ManagedIdentityCredential using an env var (#5997)
* Remove support for customizing the IMDS endpoint within ManagedIdentityCredential using an env var

* Remove test after merge.

* Revert "Remove test after merge."

This reverts commit 0d1a4fb8ca5c34bc253e999a86d337bbcddea63e.

* Only remove the test, after merge.

* Move imds endpoint url to a named const string and add doc link
2024-10-03 13:49:34 -07:00
Ahson Khan
d22781c84a
Use static factory methods to create ManagedIdentityId rather than an enum (#6051)
* Use a static factory method

* Update tests and samples.

* Remove unnecessary std::move and update the samples in readme.

* Address PR feedback - use more real values for resourceIDs in tests.

* Update tests and samples to use resourceID strings with the expected prefix.

* Fix test assert.
2024-10-02 09:22:29 -07:00
Ahson Khan
1ce3178c42
In ClientCertificateCredential, add the x5c parameter of the JWT token as a JSON array rather than a JSON string. (#6052)
* In ClientCertificateCredential, add the x5c parameter of the JWT token as a JSON array rather than a JSON string.

* Update sdk/identity/azure-identity/src/client_certificate_credential.cpp

Co-authored-by: Ray Luo <rayluo.mba@gmail.com>

---------

Co-authored-by: Ray Luo <rayluo.mba@gmail.com>
2024-10-01 22:01:59 -07:00
Anton Kolesnyk
171386533a
Fix/unify links in CHANGELOG.md files (#6048)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2024-09-30 12:35:55 -07:00
Ahson Khan
aa728eed6d
Use code snippets from managed identity credential samples in identity readme doc and fix minor generation issues (#6020)
* Use code snippets from managed identity credential samples in identity readme doc.

* Generate readme from snippets.

* Update snippet generation script to remove unnecessary indentation and extra new line at eof.

* Update Snippet Generation doc to show a concrete example on how to run it.

* Update other repo READMEs with the generation fixes.

* Fix KeyVault Secrets sample and use the snippets in its README

* Use the added sample snippet.
2024-09-25 16:56:57 -07:00
Ahson Khan
023469bc18
Remove unused included header from core that isn't available in the GA'd version (#6042) 2024-09-25 16:09:22 -07:00
Ahson Khan
309a390947
Add a readme section for user and system assigned managed identity for ManagedIdentityCredential. (#5838)
* Add a readme section for user and system assigned managed identity for
MICredential.

* Update the README to reflect new API surface and add section about Object ID.

* Mention object ID in the intro.

* Reorder the list of IDs mentioned to match the section order.
2024-09-21 07:00:12 +00:00
Ahson Khan
b1f147e884
Updated the request header sent to the OIDC endpoint in so it doesn't result in a redirect response when an invalid system access token is provided. (#6019)
* Updated the request header sent to the OIDC endpoint in  so it doesn't result in a redirect response when an invalid system access token is provided.

* Add comment on what X-TFS-FedAuthRedirect does.
2024-09-20 17:42:57 -07:00
Ahson Khan
641dcc84f1
Allow x-vss-e2eid response header to be logged in AzurePipelinesCredential for diagnostics. (#6001)
* Allow x-vss-e2eid response header to be logged in AzurePipelinesCredential for diagnostics.

* Dont redact the x-msedge-ref header either.

* Add the necessary response headers to the exception message.

* Update cspell.

* Update CL

* Fix size_t comparison

* Use std::array to get the size() method.

* Add the <array> include directive to be explicit.
2024-09-20 17:26:30 -07:00
Ahson Khan
d1cd23f4c1
Address archboard review feedback for new Azure Identity features - renames (#6000) 2024-09-18 16:07:46 -07:00
Azure SDK Bot
eeaa711966
Increment package version after release of azure-identity (#5999) 2024-09-17 18:00:22 -07:00
Ahson Khan
d7b63eef12
Add const& to input std::string params in ClientCertificateCredential. (#5993) 2024-09-17 15:56:31 -07:00
Ahson Khan
102da820c6
Prepare for Azure Identity September Beta Release (#5977) 2024-09-17 10:10:08 -07:00
Ahson Khan
e7420dfd04
Accept base64 (PEM) encoded certificate as std::string instead of vector<uint8_t> (#5991)
* Accept base64 (PEM) encoded certificate as std::string instead of vector<uint8_t>

* Fix unix implementation and remove use of privacy enhance mail in comments, in favor of PEM
2024-09-16 12:10:39 -07:00
Ahson Khan
639fc9f594
Add support for passing in the x509 certificate and its corresponding private key directly to ClientCertificateCredential, rather than reading from a pem file. (#5989)
* Add support for passing in the x509 certificate and its corresponding private key directly to , rather than reading from a pem file.

* Move the x509 and pkey objects

* Add basic test.

* Fix doc comment due to merge.

* Fix merge, add back the bool

* Pass in bool in other locations

* Fix finding pem cert content from memory and add tests with send chain true.

* Use d2i_PrivateKey_bio instead of PEM_read_bio_PrivateKey since the private key isn't in pem format.

* Fix doc comments to match the type name rather than copy/paste typo from client secret cred.

* Make options optional and add invalid content tests.

* Disable cspell in some places within tests.

* Make exception message consistent between platforms when reading a file.
2024-09-14 11:12:53 -07:00
Ahson Khan
e1afe4d7ea
Add support for sending an x5c parameter in the JWT token header for ClientCertificateCredential. (#5988)
* Add public surface area to support sending a chain of certs.

* Add x5c param to the JWT token.

* Simplify test.

* Address PR feedback and fix typo.

* Fix typo.
2024-09-13 19:35:40 -07:00
Scott Addie
df6f5c910d
Create credential chains section in Azure Identity README (#5973) 2024-09-12 14:48:20 +00:00
Ahson Khan
ea3f1442b2
Move the ResourceIdentifier type from Azure::Identity to Azure::Core. (#5864)
* Move the ResourceIdentifier type from Identity to Azure::Core.

* Fix the namespace in the source cpp file.

* Fix managed identity credential tests.

* Fix clang format.
2024-09-05 15:22:18 -04:00
Ahson Khan
7a9c54d915
Remove the ResourceIdentifier accepting ctor overload for ManagedIdentityCredential. (#5928) 2024-08-19 15:07:55 -07:00
Ahson Khan
042d2ed734
Add more input validation for passing in an empty id, or an invalid enum value. (#5924)
* Add more input validation for passing in an empty id, or an invalid enum
value.

* Fix typo in exception message.
2024-08-19 10:35:07 -07:00
Ahson Khan
54a7bc363b
Add support for providing an object ID to ManagedIdentityCredential. (#5910)
* Add support for providing an object ID to ManagedIdentityCredential.

* Update cspell checks.

* Add support for creating a Uuid from a string, and use that as the
MICred overload for objectId.

* Add a remark comment to make it clear that object and client ids are not interchangeable.

* Remove the non-const ToString() as that isn't required.

* Update tests to use valid hex Uuid values.

* Use a discriminated union design approach with a ManagedIdentityType
object and ManagedIdentityIdType enum.

* Fix typo and remove Uuid CreateFromString.

* Address PR feedback.

* Update doc comment.

* Update comments and exception message to consistently use hyphens
between user/system and assigned.
2024-08-16 20:47:05 -07:00
Ahson Khan
cf562e0d12
Do not pass a client ID into the request body for MICredential within a Cloud Shell environment, but rather throw, as not supported. (#5837)
* Do not pass in a client ID into the request body in a Cloud Shell
environment, but rather throw, as not supported.

* Address PR feedback - reword exception to avoid mention of SAI.

* Address PR feedback - use param name in exception.
2024-08-13 16:26:03 -07:00
George Arama
f85dd16ab9
Identity perf pipeline run triggers (#5892)
* update changelog

* test 1
2024-08-12 15:37:14 -07:00
Ahson Khan
4f77d817b9
Revert "Pull beta-only changes out of identity for the August GA release (#5863)" (#5889)
This reverts commit 60dff1dac1.
2024-08-09 11:35:24 -07:00
Azure SDK Bot
28baef9b80
Increment package version after release of azure-identity (#5880) 2024-08-07 10:21:36 -07:00
Ahson Khan
bee901e0b0
Update the TSG for AzurePipelinesCredential. (#5736)
* Update the TSG for AzurePipelinesCredential.

* Add a section to APC TSG about invalid client id.

* Add more error cases.

* Revert test change.
2024-08-02 17:44:08 -07:00
Ahson Khan
1d9ccf4434
Prepare for the August Identity GA release. (#5862) 2024-08-02 16:07:13 -07:00
Ahson Khan
60dff1dac1
Pull beta-only changes out of identity for the August GA release (#5863)
* Revert "Add support for providing a Resource ID to ManagedIdentityCredential. (#5832)"

This reverts commit 193bbe6963.

* Revert "Add support for customizing the IMDS endpoint within ManagedIdentityCredential using an env var. (#5834)"

This reverts commit 00304a0556.
2024-08-02 16:06:04 -07:00
Ahson Khan
5fd26a6832
Use client assertion credential within AzurePipelinesCredential and WorkloadIdentityCredential (#5802)
* Use ClientAssertionCredential within AzurePipelinesCredential.

* Use ClientAssertionCredential in WorkloadIdentityCredential.

* Fix DefaultAzureCredentia.LogMessages test since an extra log got added.

* Disable tests that dont correctly simulate the token request and return
the test response.

* Address PR feedback and make sure base options are passed in to underlying
client assertion credential.

* Address PR feedback - move credential ctor into validation checks.

* Address PR feedback, add const.

* Add a ClientAssertionCredentialImpl to make sure logs use the calling
credential name.
2024-08-02 16:05:01 -07:00
George Arama
34c2441523
Enable UseFederatedAuth by default (#5852)
* enable use federated

* 401 unauthorized

* 401

* cleanup readmes

* DISABLE RUN

* Remove UseFederatedAuth overrides from ci.yml

* DISABLE RUN for admin samples,
2024-07-31 17:10:39 -07:00
Anton Kolesnyk
2c0a35dad4
Undo unnecessary Core vcpkg dependency version bump (#5860)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2024-07-31 22:23:29 +00:00
Anton Kolesnyk
0f62b3aa63
Add consumption-time value of __cplusplus to User-Agent (#5662)
* Add consumption-time value of __cplusplus to User-Agent

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2024-07-29 18:31:51 -07:00
Azure SDK Bot
cce5fc98a6
Increment package version after release of azure-identity (#5835) 2024-07-22 20:26:28 -07:00
Ahson Khan
b1674473eb
Prepare for the July Identity beta release. (#5770)
* Prepare for the July Identity beta release.

* Update release date.

* Update CL - remove empty headings.
2024-07-22 19:06:04 -07:00
Ahson Khan
193bbe6963
Add support for providing a Resource ID to ManagedIdentityCredential. (#5832)
* Add support for providing a Resource ID to ManagedIdentityCredential.

* Fix typo in param name.

* Fix clang format and undo removing of private methods (that are unused).

* Address PR feedback.

* Add back Azure:: to fix doxygen docs issue.
2024-07-22 19:00:13 -07:00