-
Notifications
You must be signed in to change notification settings - Fork 219
Add admin-as-app authentication #6649
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
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success3374 tests passing in 1383 suites. Report generated by 🧪jest coverage report action from 8d6a6a3 |
9dc2eb8 to
8d6a6a3
Compare
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/session.d.ts@@ -122,4 +122,15 @@ export declare function ensureAuthenticatedBusinessPlatform(scopes?: BusinessPla
* @returns A promise that resolves when the logout is complete.
*/
export declare function logout(): Promise<void>;
+/**
+ * Ensure that we have a valid Admin session for the given store, with access on behalf of the app.
+ *
+ * See for access on behalf of a user.
+ *
+ * @param storeFqdn - Store fqdn to request auth for.
+ * @param clientId - Client ID of the app.
+ * @param clientSecret - Client secret of the app.
+ * @returns The access token for the Admin API.
+ */
+export declare function ensureAuthenticatedAdminAsApp(storeFqdn: string, clientId: string, clientSecret: string): Promise<AdminSession>;
export {};
\ No newline at end of file
|

WHY are these changes introduced?
To enable the CLI to make authenticated requests to the Admin API on behalf of the app, rather than on behalf of the logged in user. This is useful for tasks where its important that the app's access and identity is used.
WHAT is this pull request doing?
adminAsAppRequestDocfunction to execute GraphQL queries against the Admin API on behalf of an appensureAuthenticatedAdminAsAppto obtain app-based authentication tokens