Skip to content

Commit 7695955

Browse files
committed
Update references to SetNetworkCredentials
1 parent 71cc75c commit 7695955

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/code/FindHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public IEnumerable<PSResourceInfo> FindByResourceName(
204204
repositoryNamesToSearch.Add(currentRepository.Name);
205205

206206
// Set network credentials via passed in credentials, AzArtifacts CredentialProvider, or SecretManagement.
207-
_networkCredential = Utils.SetNetworkCredentials(currentRepository, _networkCredential, _cmdletPassedIn);
207+
_networkCredential = currentRepository.SetNetworkCredentials(_networkCredential, _cmdletPassedIn);
208208

209209
ServerApiCall currentServer = ServerFactory.GetServer(currentRepository, _cmdletPassedIn, _networkCredential);
210210
if (currentServer == null)
@@ -392,7 +392,7 @@ public IEnumerable<PSCommandResourceInfo> FindByCommandOrDscResource(
392392
repositoryNamesToSearch.Add(currentRepository.Name);
393393

394394
// Set network credentials via passed in credentials, AzArtifacts CredentialProvider, or SecretManagement.
395-
_networkCredential = Utils.SetNetworkCredentials(currentRepository, _networkCredential, _cmdletPassedIn);
395+
_networkCredential = currentRepository.SetNetworkCredentials(_networkCredential, _cmdletPassedIn);
396396

397397
ServerApiCall currentServer = ServerFactory.GetServer(currentRepository, _cmdletPassedIn, _networkCredential);
398398
if (currentServer == null)
@@ -599,7 +599,7 @@ public IEnumerable<PSResourceInfo> FindByTag(
599599
repositoryNamesToSearch.Add(currentRepository.Name);
600600

601601
// Set network credentials via passed in credentials, AzArtifacts CredentialProvider, or SecretManagement.
602-
_networkCredential = Utils.SetNetworkCredentials(currentRepository, _networkCredential, _cmdletPassedIn);
602+
_networkCredential = currentRepository.SetNetworkCredentials(_networkCredential, _cmdletPassedIn);
603603

604604
ServerApiCall currentServer = ServerFactory.GetServer(currentRepository, _cmdletPassedIn, _networkCredential);
605605
if (currentServer == null)

src/code/PSRepositoryInfo.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,19 @@ public static bool IsContainerRegistry(string uri)
113113

114114
return false;
115115
}
116-
117-
public static NetworkCredential SetNetworkCredentials(PSRepositoryInfo repository, NetworkCredential networkCredential, PSCmdlet cmdletPassedIn)
116+
117+
public NetworkCredential SetNetworkCredentials(NetworkCredential networkCredential, PSCmdlet cmdletPassedIn)
118118
{
119119
NetworkCredential networkCreds = new NetworkCredential();
120-
if (repository.CredentialProvider.Equals(PSRepositoryInfo.CredentialProviderType.AzArtifacts))
120+
if (CredentialProvider.Equals(PSRepositoryInfo.CredentialProviderType.AzArtifacts))
121121
{
122122
cmdletPassedIn.WriteVerbose("Setting credential provider network credentials");
123-
networkCreds = Utils.SetCredentialProviderNetworkCredential(repository, networkCredential, cmdletPassedIn);
123+
networkCreds = Utils.SetCredentialProviderNetworkCredential(this, networkCredential, cmdletPassedIn);
124124
}
125125
else
126126
{
127127
cmdletPassedIn.WriteVerbose("Setting Secret Management network credentials");
128-
networkCreds = Utils.SetSecretManagementNetworkCredential(repository, networkCredential, cmdletPassedIn);
128+
networkCreds = Utils.SetSecretManagementNetworkCredential(this, networkCredential, cmdletPassedIn);
129129
}
130130

131131
return networkCreds;

src/code/PublishHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ internal void PushResource(string Repository, string modulePrefix, bool SkipDepe
381381
}
382382

383383
// Set network credentials via passed in credentials, AzArtifacts CredentialProvider, or SecretManagement.
384-
_networkCredential = Utils.SetNetworkCredentials(repository, _networkCredential, _cmdletPassedIn);
384+
_networkCredential = repository.SetNetworkCredentials(_networkCredential, _cmdletPassedIn);
385385

386386
// Check if dependencies already exist within the repo if:
387387
// 1) the resource to publish has dependencies and

0 commit comments

Comments
 (0)