-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1907 from AzureAD/msal-throttling
[2.0] msal 2.0 supports throttling
- Loading branch information
Showing
25 changed files
with
798 additions
and
33 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
change/@azure-msal-browser-2020-08-11-12-05-23-msal-throttling.json
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,8 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "Added client-side throttling to enhance server stability (#1907)", | ||
"packageName": "@azure/msal-browser", | ||
"email": "jamckenn@microsoft.com", | ||
"dependentChangeType": "patch", | ||
"date": "2020-08-11T19:04:58.604Z" | ||
} |
8 changes: 8 additions & 0 deletions
8
change/@azure-msal-common-2020-08-11-12-05-23-msal-throttling.json
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,8 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "Added client-side throttling to enhance server stability (#1907)", | ||
"packageName": "@azure/msal-common", | ||
"email": "jamckenn@microsoft.com", | ||
"dependentChangeType": "patch", | ||
"date": "2020-08-11T19:05:23.196Z" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. | ||
*/ | ||
import { ThrottlingConstants } from "../../utils/Constants"; | ||
|
||
export class ThrottlingEntity { | ||
// Unix-time value representing the expiration of the throttle | ||
throttleTime: number; | ||
// Information provided by the server | ||
error?: string; | ||
errorCodes?: Array<string>; | ||
errorMessage?: string; | ||
subError?: string; | ||
|
||
/** | ||
* validates if a given cache entry is "Throttling", parses <key,value> | ||
* @param key | ||
* @param entity | ||
*/ | ||
static isThrottlingEntity(key: string, entity?: object): boolean { | ||
|
||
let validateKey: boolean = false; | ||
if (key) { | ||
validateKey = key.indexOf(ThrottlingConstants.THROTTLING_PREFIX) === 0; | ||
} | ||
|
||
let validateEntity: boolean = true; | ||
if (entity) { | ||
validateEntity = entity.hasOwnProperty("throttleTime"); | ||
} | ||
|
||
return validateKey && validateEntity; | ||
} | ||
} |
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
Oops, something went wrong.