@simpleview/sv-auth-client 6.25.1 → 6.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simpleview/sv-auth-client",
3
- "version": "6.25.1",
3
+ "version": "6.26.0",
4
4
  "description": "Client for communicating with sv-auth",
5
5
  "author": "Owen Allen <owenallenaz@gmail.com>",
6
6
  "dependencies": {
package/readme.md CHANGED
@@ -110,6 +110,8 @@ const { GraphServer } = require("@simpleview/sv-graphql-client");
110
110
  const graphServer = new GraphServer({ graphUrl : GRAPH_URL, prefixes : [AuthPrefix] });
111
111
  ```
112
112
 
113
+ `login_service_account({ input, fields })` logs in with a service-account email and private key. `login_service_account_id_token({ input, fields })` logs in with a Google ID token in `input.id_token`. Both return the auth result for the fields you request.
114
+
113
115
  ### canIds(perm, node_type, bindings)
114
116
 
115
117
  This function is identical to `User.canIds` but requires you to pass in the `bindings` manually, it should only be used in cases where you cannot use `DirectiveCheckPerm`. See the documentation for [`User.canIds`](#User.canIds) for how it functions.
@@ -375,6 +375,26 @@ class AuthPrefix {
375
375
  return result.auth.login_service_account;
376
376
  }
377
377
 
378
+ async login_service_account_id_token({ input, fields }) {
379
+ const result = await query({
380
+ query : `
381
+ query($input : auth_login_service_account_id_token_input!) {
382
+ auth {
383
+ login_service_account_id_token(input: $input) {
384
+ ${fields}
385
+ }
386
+ }
387
+ }
388
+ `,
389
+ variables : {
390
+ input
391
+ },
392
+ url : this._graphUrl
393
+ });
394
+
395
+ return result.auth.login_service_account_id_token;
396
+ }
397
+
378
398
  async login_sso_token({ input, fields }) {
379
399
  const result = await query({
380
400
  query : `