-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2501ee3
commit 6cbe7bc
Showing
36 changed files
with
605 additions
and
453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Calamari.AzureAppService.Azure; | ||
using Calamari.CloudAccounts; | ||
|
||
namespace Calamari.AzureAppService | ||
{ | ||
public interface IBasicAuthService | ||
{ | ||
Task<string> GetBasicAuthCreds(IAzureAccount azureAccount, AzureTargetSite targetSite, CancellationToken cancellationToken); | ||
} | ||
|
||
public class BasicAuthService : IBasicAuthService | ||
{ | ||
readonly IPublishingProfileService publishingProfileService; | ||
|
||
public BasicAuthService(IPublishingProfileService publishingProfileService) | ||
{ | ||
this.publishingProfileService = publishingProfileService; | ||
} | ||
|
||
public async Task<string> GetBasicAuthCreds(IAzureAccount azureAccount, AzureTargetSite targetSite, CancellationToken cancellationToken) | ||
{ | ||
var publishingProfile = await publishingProfileService.GetPublishingProfile(targetSite, azureAccount); | ||
var basicAuth = $"{publishingProfile.Username}:{publishingProfile.Password}"; | ||
var credential = Convert.ToBase64String(Encoding.ASCII.GetBytes(basicAuth)); | ||
return credential; | ||
} | ||
} | ||
} |
Oops, something went wrong.