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

Switch to ontologies read/write in default scopes #954

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
>
> Full docs on the `changesets` tool can be found at the [changesets/changesets github repo](https://github.com/changesets/changesets).
7. If you're curious what the final build output might look like you can run `pnpm build` from root.
8. Run all lint rules and tests with `pnpm check` from root.
8. Run all lint rules and tests with `pnpm check` from root.
5 changes: 4 additions & 1 deletion packages/cli.common/src/commands/auth/login/loginFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ function generateAuthorizeUrl(
"code_challenge_method",
codeChallenge.codeChallengeMethod,
);
queryParams.append("scope", ["offline_access", "api:read-data"].join(" "));
queryParams.append(
"scope",
["offline_access", "api:ontologies-read"].join(" "),
);

return join(baseUrl, "multipass", "api", "oauth2", "authorize") + `?`
+ queryParams.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const publicOauthClient = createPublicOauthClient(
// where to redirect after login, defaults to "page before redirect"
/* post login page */ undefined,
//
// Scopes to use, defaults to: ["api:read-data", "api:write-data"],
// Scopes to use, defaults to: ["api:ontologies-read", "api:ontologies-write"],
/* scopes */ undefined,
);

Expand Down
2 changes: 1 addition & 1 deletion packages/oauth/src/createConfidentialOauthClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function createConfidentialOauthClient(
client_id: string,
client_secret: string,
url: string,
scopes: string[] = ["api:read-data", "api:write-data"],
scopes: string[] = ["api:ontologies-read", "api:ontologies-write"],
fetchFn: typeof globalThis.fetch = globalThis.fetch,
ctxPath: string = "/multipass",
): ConfidentialOauthClient {
Expand Down
2 changes: 1 addition & 1 deletion packages/oauth/src/createPublicOauthClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function createPublicOauthClient(
const oauthHttpOptions: HttpRequestOptions = { [customFetch]: fetchFn };

if (scopes.length === 0) {
scopes = ["api:read-data", "api:write-data"];
scopes = ["api:ontologies-read", "api:ontologies-write"];
}

const { makeTokenAndSaveRefresh, getToken } = common(
Expand Down
Loading