This pull request involves a significant refactor of the configuration and authentication handling in the internal/config and internal/api packages. The main goal is to simplify the configuration structure by moving several fields from ProviderCredentials to ProviderConfig.
Configuration Refactor:
internal/config/config.go: Moved several fields from ProviderCredentials to ProviderConfig, including TestMode, Urls, TelemetryOptout, Cloud, and TerraformVersion. Updated methods to reflect these changes. [1][2]
Authentication Updates:
internal/api/auth.go: Updated various authentication methods to use the new ProviderConfig structure instead of ProviderCredentials. This includes methods like AuthenticateClientCertificate, AuthenticateUsingCli, AuthenticateClientSecret, and AuthenticateOIDC. [1][2][3][4][5][6]
Provider Initialization:
internal/provider/provider.go: Modified the NewPowerPlatformProvider and Configure functions to align with the new ProviderConfig structure. This includes setting fields like TestMode, UseCli, UseOidc, TenantId, ClientId, and others directly on ProviderConfig. [1][2][3][4][5][6]
Minor Fixes:
internal/api/api_client.go: Fixed a conditional check to use client.Config.TestMode instead of client.Config.Credentials.TestMode.
This pull request involves a significant refactor of the configuration and authentication handling in the
internal/config
andinternal/api
packages. The main goal is to simplify the configuration structure by moving several fields fromProviderCredentials
toProviderConfig
.Configuration Refactor:
internal/config/config.go
: Moved several fields fromProviderCredentials
toProviderConfig
, includingTestMode
,Urls
,TelemetryOptout
,Cloud
, andTerraformVersion
. Updated methods to reflect these changes. [1] [2]Authentication Updates:
internal/api/auth.go
: Updated various authentication methods to use the newProviderConfig
structure instead ofProviderCredentials
. This includes methods likeAuthenticateClientCertificate
,AuthenticateUsingCli
,AuthenticateClientSecret
, andAuthenticateOIDC
. [1] [2] [3] [4] [5] [6]Provider Initialization:
internal/provider/provider.go
: Modified theNewPowerPlatformProvider
andConfigure
functions to align with the newProviderConfig
structure. This includes setting fields likeTestMode
,UseCli
,UseOidc
,TenantId
,ClientId
, and others directly onProviderConfig
. [1] [2] [3] [4] [5] [6]Minor Fixes:
internal/api/api_client.go
: Fixed a conditional check to useclient.Config.TestMode
instead ofclient.Config.Credentials.TestMode
.