@tidecloak/verify 0.12.14 → 0.12.16

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/README.md CHANGED
@@ -30,9 +30,9 @@ import { verifyTideCloakToken } from '@tidecloak/verify';
30
30
 
31
31
  | Parameter | Type | Description |
32
32
  | -------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------- |
33
- | `config` | `object` | Your TideCloak adapter JSON (the Keycloak client configuration you download from your realm settings). |
33
+ | `config` | `object` | Your TideCloak adapter JSON (the Tidecloak client configuration you download from your realm settings). |
34
34
  | `token` | `string` | The raw JWT (access token) to verify. |
35
- | `allowedRoles` | `string[]` (optional) | Array of Keycloak realm or client roles. If provided, the user must have at least one of these roles in their token. |
35
+ | `allowedRoles` | `string[]` (optional) | Array of Tidecloak realm or client roles. If provided, the user must have at least one of these roles in their token. |
36
36
 
37
37
  **Returns:**
38
38
  `Promise<object | null>`
@@ -46,7 +46,7 @@ Internally, `verifyTideCloakToken` uses the [jose](https://github.com/panva/jose
46
46
 
47
47
  1. Ensure a token is present.
48
48
  2. Construct the correct issuer URL from `config['auth-server-url']` and `config.realm`.
49
- 3. Choose between a local JWK Set (`config.jwk.keys`) or fetch the JWK Set remotely from Keycloak.
49
+ 3. Choose between a local JWK Set (`config.jwk.keys`) or fetch the JWK Set remotely from Tidecloak.
50
50
  4. Verify the token's signature, issuer, and `azp` (authorized party) against `config.resource`.
51
51
  5. Extract realm (`payload.realm_access.roles`) and client (`payload.resource_access[resource].roles`) roles.
52
52
  6. Check for at least one matching role if `allowedRoles` is specified.
@@ -4,7 +4,7 @@ import { jwtVerify, createLocalJWKSet, createRemoteJWKSet } from "jose";
4
4
  *
5
5
  * @param {object} config - Imported TideCloak configuration (parsed JSON).
6
6
  * @param {string} token - access token to verify.
7
- * @param {string[]} [allowedRoles] - Array of Keycloak realm or client roles; user must have at least one.
7
+ * @param {string[]} [allowedRoles] - Array of Tidecloak realm or client roles; user must have at least one.
8
8
  * @returns {Promise<object|null>} - The token payload if valid and role-check passes, otherwise null.
9
9
  */
10
10
  export async function verifyTideCloakToken(config, token, allowedRoles = []) {
@@ -4,7 +4,7 @@ import { jwtVerify, createLocalJWKSet, createRemoteJWKSet } from "jose";
4
4
  *
5
5
  * @param {object} config - Imported TideCloak configuration (parsed JSON).
6
6
  * @param {string} token - access token to verify.
7
- * @param {string[]} [allowedRoles] - Array of Keycloak realm or client roles; user must have at least one.
7
+ * @param {string[]} [allowedRoles] - Array of Tidecloak realm or client roles; user must have at least one.
8
8
  * @returns {Promise<object|null>} - The token payload if valid and role-check passes, otherwise null.
9
9
  */
10
10
  export async function verifyTideCloakToken(config, token, allowedRoles = []) {
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @param {object} config - Imported TideCloak configuration (parsed JSON).
5
5
  * @param {string} token - access token to verify.
6
- * @param {string[]} [allowedRoles] - Array of Keycloak realm or client roles; user must have at least one.
6
+ * @param {string[]} [allowedRoles] - Array of Tidecloak realm or client roles; user must have at least one.
7
7
  * @returns {Promise<object|null>} - The token payload if valid and role-check passes, otherwise null.
8
8
  */
9
9
  export function verifyTideCloakToken(config: object, token: string, allowedRoles?: string[]): Promise<object | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidecloak/verify",
3
- "version": "0.12.14",
3
+ "version": "0.12.16",
4
4
  "description": "A lightweight utility for server-side verification of TideCloak-issued JSON Web Tokens (JWTs).",
5
5
  "exports": {
6
6
  ".": {