* Add entra ID metrics
This commit adds metrics for entra ID sync. This is the OSS part, it
contains the msgraph client metrics.
As many different parts of Teleport are using the msgraph client and
might not have access to a metric registerer yet, the client gracefully
handles not being given a metric registry. In this case it won't
register its metrics, we don't want to continue polluting the global
metrics registry.
* lint
* Capture status code in GraphError
* Add comments to GraphError fields
* Parse auth errors returned by AzureTokenProvider
* Update tests to use NewClient
* Add logging to lib/msgraph.Client
* Add client-request-id header
* Fix typos in api/types.ValidateMSGraphEndpoints
* Ignore StatusCode field during unmarshalling
* Check for `authFailedError.RawResponse.Body != nil`
* Move credential verification from e/lib/intune to lib/msgraph
* Remove request logging
* set and validate default graph endpoint
* add IterateUsersTransitiveMemberOf method to list user groups
* run make fix-imports
* fix: return on group type error:
- updates test
* Initial command to create the managed identity and role
* Adding permissions and applying command params
* Adding graph permissions to the MSI
* Updating parameters
* Adding some details and cleaning up comments
* Fixing go.sum
* Linting
* License
* PR feedback
* Decoupling sync config with an interface for testing
* Tweaks to test mocking
* PR feedback
* Rebase adjustments
* PR feedback
* Switch to empty struct maps instead of bool maps for set representation
* Godocs
* Adding user agent to Azure SDK requests
* Linting
* [entraid] Expose Application `OptionalClaims` and Groups AD settings
This PR exposes Entra ID settings for `OptionalClaims` where applications store the info regarding how the group claim is mapped to SAML properties.
It also exposes the GroupID settings:
- `onPremisesDomainName`
- `onPremisesNetBiosName`
- `onPremisesSamAccountName`
That will be later used compute group claims with the Teleport SAML connector.
Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
* handle code review comments
---------
Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
* Add MS Graph client skeleton
* Complete retry logic
* Add GetID() to GroupMember
* Parse MS Graph API error responses
* Pull out page size into config
* Add missing "patch" methods to client interface
* Move code around
* Factor out roundtrip()
* Fill out remaining methods
* Add godocs and solve lints
* Run gci
* Move godocs to the interface
* Add missing method
* Finish errors_test
* close body in test
* nit
* Add license headers
* Move azureoidc onboarding code to msgraph.Client
* Make AzureTokenProvider public
* Use cmp.Or to shorten config defaults handling
* Address review nits
* Parallelize tests
* nit
* Respect context cancellation in retry logic
* Utilize BlockUntil in tests
* Remove Client interface, make client struct public
* Prefer defaults.HTTPClient to http.DefaultClient
* Iterate entra apps, do not buffer all in memory
* nit
* Set additional timeouts on default HTTP client
* Escape path segments when constructing URLs
* Add a general timeout for default HTTP client