Skip to content
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

Support more APIs, auth refactoring, multi-tenant auth, implement autorest.Authorizer, remove Azure Germany #123

Merged
merged 10 commits into from
Nov 16, 2021

Conversation

manicminer
Copy link
Owner

@manicminer manicminer commented Nov 4, 2021

  • Auth package refactoring:

    • Remove the auth.Api type and instead use environments.Api directly
    • Use the resource URI instead of the friendly name for Azure CLI auth tokens
  • Add the AuxiliaryTokens() method to the auth.Authorizer interface to support obtaining tokens for additional tenants

  • Expand support in auth.AutorestAuthorizerWrapper to support any autorest.Authorizer

    • autorest.BearerAuthorizer and autorest.MultiTenantBearerAuthorizer are fully supported with access tokens, refresh tokens and expiry
    • Other authorizers can supply access tokens only
  • Support auxiliary tenants with client secret and client certificate authorizers

  • Implement the autorest.Authorizer interface with auth.CachedAuthorizer (which wraps all supported Authorizers)

    • This allows authorizers to be used with https:/Azure/go-autorest, with multi-tenant support, with the exception of auth.MsiAuthorizer
  • Export environment configs for more management plane APIs:

    • Resource Manager
    • Batch Management
    • Data Lake
    • Gallery
    • KeyVault
    • Operational Insights
    • OSS RDBMS
    • Service Bus
    • Service Management (Azure Classic)
    • SQL Database
    • Storage
    • Synapse
  • Refactor and tidy up tests for the msgraph package

  • Say goodbye to Azure Germany 🇩🇪

⚠️ BREAKING CHANGES:

  • The signatures for auth.NewClientCertificateAuthorizer, auth.NewClientSecretAuthorizer and auth.NewAzureCliAuthorizer have changed to accommodate passing additional tenant IDs for multi-tenant authorization.

@manicminer manicminer changed the title Environment configuration for more APIs including Resource Manager Support more APIs, multi-tenant auth, implement autorest.Authorizer Nov 9, 2021
@manicminer manicminer added breaking change Indicates a non-backwards compatible change enhancement New feature or request package/auth package/environments labels Nov 9, 2021
@manicminer manicminer changed the title Support more APIs, multi-tenant auth, implement autorest.Authorizer Support more APIs, auth refactoring, multi-tenant auth, implement autorest.Authorizer, remove Azure Germany Nov 10, 2021
@manicminer manicminer marked this pull request as ready for review November 10, 2021 13:13
@manicminer manicminer added this to the v0.34.0 milestone Nov 10, 2021
manicminer added a commit to hashicorp/go-azure-helpers that referenced this pull request Nov 10, 2021
manicminer added a commit to hashicorp/go-azure-helpers that referenced this pull request Nov 10, 2021
- Remove auth.Api type
- NewAuthorizer and family helper funcs now accept an environments.Api argument instead
- Refactor msgraph tests to tidy up client instantiation and comodditize
  across all tests, improves test readability
- auth.AzureCliAuthorizer now supports auxiliary tenants
- Remove AzureCliName from environments.Api definitions, instead use the
  resource URI when calling az-cli
- Add environment.Api definitions for additional supported APIs
- Add additional definitions to environments.Environment definitions
manicminer added a commit to hashicorp/go-azure-helpers that referenced this pull request Nov 10, 2021
manicminer added a commit to hashicorp/go-azure-helpers that referenced this pull request Nov 10, 2021
@manicminer manicminer modified the milestones: v0.34.0, v0.35.0 Nov 12, 2021
Copy link
Collaborator

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor comments but this otherwise LGTM 👍

auth/auth.go Outdated Show resolved Hide resolved
auth/azcli.go Show resolved Hide resolved
auth/azcli.go Show resolved Hide resolved
auth/msi.go Outdated Show resolved Hide resolved
internal/test/testing.go Outdated Show resolved Hide resolved
…est, clean up ctx handling for connection and clients
@manicminer manicminer merged commit d80fd38 into main Nov 16, 2021
@manicminer manicminer deleted the feature/more-apis branch November 16, 2021 23:51
manicminer added a commit that referenced this pull request Nov 16, 2021
manicminer added a commit that referenced this pull request Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Indicates a non-backwards compatible change enhancement New feature or request package/auth package/environments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants