Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add canary url to allowed endpoints for graph #2635

Merged
merged 4 commits into from
Jul 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 13 additions & 16 deletions packages/mgt-element/src/IGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,23 @@ export type GraphEndpoint =
| 'https://graph.microsoft.us'
| 'https://dod-graph.microsoft.us'
| 'https://graph.microsoft.de'
| 'https://microsoftgraph.chinacloudapi.cn';

/**
* MICROSOFT_GRAPH_ENDPOINTS is a set of all the valid Graph URL endpoints.
*/
export const MICROSOFT_GRAPH_ENDPOINTS: Set<GraphEndpoint> = new Set<GraphEndpoint>();
| 'https://microsoftgraph.chinacloudapi.cn'
| 'https://canary.graph.microsoft.com';

/**
* MICROSOFT_GRAPH_DEFAULT_ENDPOINT is the default Graph endpoint that is silently set on
* the providers as the baseURL.
*/
export const MICROSOFT_GRAPH_DEFAULT_ENDPOINT: GraphEndpoint = 'https://graph.microsoft.com';

(() => {
const endpoints: GraphEndpoint[] = [
MICROSOFT_GRAPH_DEFAULT_ENDPOINT,
'https://graph.microsoft.us',
'https://dod-graph.microsoft.us',
'https://graph.microsoft.de',
'https://microsoftgraph.chinacloudapi.cn'
];
endpoints.forEach(endpoint => MICROSOFT_GRAPH_ENDPOINTS.add(endpoint));
})();
/**
* MICROSOFT_GRAPH_ENDPOINTS is a set of all the valid Graph URL endpoints.
*/
export const MICROSOFT_GRAPH_ENDPOINTS: Set<GraphEndpoint> = new Set<GraphEndpoint>([
MICROSOFT_GRAPH_DEFAULT_ENDPOINT,
'https://graph.microsoft.us',
'https://dod-graph.microsoft.us',
'https://graph.microsoft.de',
'https://microsoftgraph.chinacloudapi.cn',
'https://canary.graph.microsoft.com'
]);