| | 1 | | // |
| | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 3 | | // Licensed under the MIT License. See License.txt in the project root for license information. |
| | 4 | |
|
| | 5 | | // |
| | 6 | |
|
| | 7 | | namespace Microsoft.Azure.Batch.Auth |
| | 8 | | { |
| | 9 | | using System; |
| | 10 | |
|
| | 11 | | /// <summary> |
| | 12 | | /// Shared key credentials for an Azure Batch account. |
| | 13 | | /// </summary> |
| | 14 | | public class BatchSharedKeyCredentials : BatchCredentials |
| | 15 | | { |
| | 16 | | /// <summary> |
| | 17 | | /// Gets the Batch account name. |
| | 18 | | /// </summary> |
| 299 | 19 | | public string AccountName { get; private set; } |
| | 20 | |
|
| | 21 | | /// <summary> |
| | 22 | | /// Gets the Base64 encoded account access key. |
| | 23 | | /// </summary> |
| 299 | 24 | | internal string KeyValue { get; private set; } |
| | 25 | |
|
| | 26 | | /// <summary> |
| | 27 | | /// Initializes a new instance of the <see cref="BatchSharedKeyCredentials"/> class with the specified Batch ser |
| | 28 | | /// </summary> |
| | 29 | | /// <param name="baseUrl">The Batch service endpoint.</param> |
| | 30 | | /// <param name="accountName">The name of the Batch account.</param> |
| | 31 | | /// <param name="keyValue">The Base64 encoded account access key.</param> |
| 161 | 32 | | public BatchSharedKeyCredentials(string baseUrl, string accountName, string keyValue) |
| | 33 | | { |
| 161 | 34 | | if (string.IsNullOrEmpty(baseUrl)) |
| | 35 | | { |
| 0 | 36 | | throw new ArgumentNullException("baseUrl"); |
| | 37 | | } |
| 161 | 38 | | if (string.IsNullOrEmpty(accountName)) |
| | 39 | | { |
| 0 | 40 | | throw new ArgumentNullException("accountName"); |
| | 41 | | } |
| 161 | 42 | | if (string.IsNullOrEmpty(keyValue)) |
| | 43 | | { |
| 0 | 44 | | throw new ArgumentNullException("keyValue"); |
| | 45 | | } |
| | 46 | |
|
| 161 | 47 | | this.BaseUrl = baseUrl; |
| 161 | 48 | | this.AccountName = accountName; |
| 161 | 49 | | this.KeyValue = keyValue; |
| 161 | 50 | | } |
| | 51 | | } |
| | 52 | | } |