Permalink
Cannot retrieve contributors at this time
38 lines (38 sloc)
968 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/@azure/core-auth/dist-esm/src/azureKeyCredential.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
// Copyright (c) Microsoft Corporation. | |
// Licensed under the MIT license. | |
/** | |
* A static-key-based credential that supports updating | |
* the underlying key value. | |
*/ | |
export class AzureKeyCredential { | |
/** | |
* Create an instance of an AzureKeyCredential for use | |
* with a service client. | |
* | |
* @param key - The initial value of the key to use in authentication | |
*/ | |
constructor(key) { | |
if (!key) { | |
throw new Error("key must be a non-empty string"); | |
} | |
this._key = key; | |
} | |
/** | |
* The value of the key to be used in authentication | |
*/ | |
get key() { | |
return this._key; | |
} | |
/** | |
* Change the value of the key. | |
* | |
* Updates will take effect upon the next request after | |
* updating the key value. | |
* | |
* @param newKey - The new key value to be used | |
*/ | |
update(newKey) { | |
this._key = newKey; | |
} | |
} | |
//# sourceMappingURL=azureKeyCredential.js.map |