@deephaven-enterprise/auth-nodejs 1.20240723.112-beta → 1.20240723.113-beta

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.
@@ -23,7 +23,9 @@ export declare function signWithPrivateKey(nonce: Base64Nonce, privateKey: Base6
23
23
  * Delete a list of public keys for a user.
24
24
  * @param dheClient An authenticated DHE client to use for the request.
25
25
  * @param userName The user name to delete the keys for.
26
- * @param publicKeys The list of public keys to delete.
26
+ * @param publicKeys The list of public keys to delete. Note that sentinel
27
+ * prefixes should not be included but will be determined and appended based on
28
+ * the `type` parameter.
27
29
  * @param type The algorithm type used to generate the key.
28
30
  * @returns A promise that resolves when the keys have been deleted.
29
31
  */
@@ -59,21 +59,25 @@ export function signWithPrivateKey(nonce, privateKey) {
59
59
  * Delete a list of public keys for a user.
60
60
  * @param dheClient An authenticated DHE client to use for the request.
61
61
  * @param userName The user name to delete the keys for.
62
- * @param publicKeys The list of public keys to delete.
62
+ * @param publicKeys The list of public keys to delete. Note that sentinel
63
+ * prefixes should not be included but will be determined and appended based on
64
+ * the `type` parameter.
63
65
  * @param type The algorithm type used to generate the key.
64
66
  * @returns A promise that resolves when the keys have been deleted.
65
67
  */
66
68
  export async function deletePublicKeys({ dheClient, userName, publicKeys, type, }) {
67
69
  const { dbAclWriterHost, dbAclWriterPort } = await dheClient.getServerConfigValues();
68
- const encodedAlgorithm = encodeURIComponent(type.toUpperCase());
70
+ const algorithm = type.toUpperCase();
69
71
  const encodedUserName = encodeURIComponent(userName);
70
72
  const authToken = await dheClient.createAuthToken('DbAclWriteServer');
71
73
  const apiUrl = `https://${dbAclWriterHost}:${dbAclWriterPort}/acl/publickey/${encodedUserName}`;
72
74
  const deletePromises = publicKeys.map(publicKey => {
73
- const encodedPublicKey = encodeURIComponent(publicKey);
75
+ const publicKeyWithSentinel = keyWithSentinel(type, publicKey);
76
+ // Note that URLSearchParams.toString() will encode the values, so we set
77
+ // the raw values directly.
74
78
  const query = new URLSearchParams();
75
- query.set('algorithm', encodedAlgorithm);
76
- query.set('encodedStr', encodedPublicKey);
79
+ query.set('algorithm', algorithm);
80
+ query.set('encodedStr', publicKeyWithSentinel);
77
81
  return fetch(`${apiUrl}?${query.toString()}`, {
78
82
  method: 'DELETE',
79
83
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven-enterprise/auth-nodejs",
3
- "version": "1.20240723.112-beta",
3
+ "version": "1.20240723.113-beta",
4
4
  "description": "Deephaven Enterprise Auth Utils for NodeJS",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -22,11 +22,11 @@
22
22
  "build": "tsc --build"
23
23
  },
24
24
  "dependencies": {
25
- "@deephaven-enterprise/jsapi-types": "^1.20240723.112-beta",
25
+ "@deephaven-enterprise/jsapi-types": "^1.20240723.113-beta",
26
26
  "@deephaven/utils": "^0.97.0"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public"
30
30
  },
31
- "gitHead": "09126b75130848ecd747d1da06d9cf504f389143"
31
+ "gitHead": "04c09a4d3c5ebdf01ad261a85388f9455726f5c6"
32
32
  }