@@ -5,6 +5,11 @@ import { jwtDecoder } from '@kinde/jwt-decoder';
55/**
66 * Method extracts the provided claim from the provided token type in the
77 * current session.
8+ *
9+ * Security Model: This function assumes tokens have been cryptographically
10+ * validated during session commit via commitTokensToSession. It performs
11+ * decoding only on pre-validated tokens without re-validation by design.
12+ *
813 * @param {SessionManager } sessionManager
914 * @param {string } claim
1015 * @param {ClaimTokenType } type
@@ -24,6 +29,11 @@ export const getClaimValue = async (
2429/**
2530 * Method extracts the provided claim from the provided token type in the
2631 * current session, the returned object includes the provided claim.
32+ *
33+ * Security Model: This function assumes tokens have been cryptographically
34+ * validated during session commit via commitTokensToSession. It performs
35+ * decoding only on pre-validated tokens without re-validation by design.
36+ *
2737 * @param {SessionManager } sessionManager
2838 * @param {string } claim
2939 * @param {ClaimTokenType } type
@@ -44,6 +54,11 @@ export const getClaim = async (
4454 * Method returns the organization code from the current session and returns
4555 * a boolean in the returned object indicating if the provided permission is
4656 * present in the session.
57+ *
58+ * Security Model: This function assumes tokens have been cryptographically
59+ * validated during session commit via commitTokensToSession. It performs
60+ * decoding only on pre-validated tokens without re-validation by design.
61+ *
4762 * @param {SessionManager } sessionManager
4863 * @param {string } name
4964 * @returns {{ orgCode: string | null, isGranted: boolean } }
@@ -68,6 +83,11 @@ export const getPermission = async (
6883
6984/**
7085 * Method extracts the organization code from the current session.
86+ *
87+ * Security Model: This function assumes tokens have been cryptographically
88+ * validated during session commit via commitTokensToSession. It performs
89+ * decoding only on pre-validated tokens without re-validation by design.
90+ *
7191 * @param {SessionManager } sessionManager
7292 * @returns {{ orgCode: string | null } }
7393 */
@@ -82,6 +102,11 @@ export const getOrganization = async (
82102/**
83103 * Method extracts all the permission and the organization code in the access
84104 * token in the current session.
105+ *
106+ * Security Model: This function assumes tokens have been cryptographically
107+ * validated during session commit via commitTokensToSession. It performs
108+ * decoding only on pre-validated tokens without re-validation by design.
109+ *
85110 * @param {SessionManager } sessionManager
86111 * @returns {{ permissions: string[], orgCode: string | null } }
87112 */
@@ -105,6 +130,11 @@ export const getPermissions = async (
105130/**
106131 * Method extracts all organization codes from the id token in the current
107132 * session.
133+ *
134+ * Security Model: This function assumes tokens have been cryptographically
135+ * validated during session commit via commitTokensToSession. It performs
136+ * decoding only on pre-validated tokens without re-validation by design.
137+ *
108138 * @param {SessionManager } sessionManager
109139 * @returns {{ orgCodes: string[] } }
110140 */
0 commit comments