mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 01:11:25 +00:00
added github test env client id (#1168)
This commit is contained in:
committed by
GitHub
parent
e575b94ffa
commit
6b4d6f986e
@@ -1,4 +1,9 @@
|
||||
// https://github.com/<owner>/<repo>/tree/<branch>
|
||||
|
||||
import { JunoEndpoints } from "Common/Constants";
|
||||
import { configContext } from "ConfigContext";
|
||||
import { userContext } from "UserContext";
|
||||
|
||||
// The url when users visit a repo/branch on github.com
|
||||
export const RepoUriPattern = /https:\/\/github.com\/([^/]*)\/([^/]*)\/tree\/([^?]*)/;
|
||||
|
||||
@@ -60,3 +65,15 @@ export function toContentUri(owner: string, repo: string, branch: string, path:
|
||||
export function toRawContentUri(owner: string, repo: string, branch: string, path: string): string {
|
||||
return `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${path}`;
|
||||
}
|
||||
|
||||
export function GetGithubClientId(): string {
|
||||
const junoEndpoint = userContext.features.junoEndpoint ?? configContext.JUNO_ENDPOINT;
|
||||
if (
|
||||
junoEndpoint === JunoEndpoints.Test ||
|
||||
junoEndpoint === JunoEndpoints.Test2 ||
|
||||
junoEndpoint === JunoEndpoints.Test3
|
||||
) {
|
||||
return configContext.GITHUB_TEST_ENV_CLIENT_ID;
|
||||
}
|
||||
return configContext.GITHUB_CLIENT_ID;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user