Skip to content

Conversation

Copy link

Copilot AI commented Nov 23, 2025

Addresses code review feedback from PR #20 identifying three identical JSDoc comment blocks for each method in libs/Jwt.ts.

Changes

  • Removed duplicate JSDoc blocks from verifyOffline, decode, and verify methods
  • Retained the most complete documentation variant for each method (includes @throws and @example tags)

Before

/**
 * Verifies a token using a public certificate. For security reasons the
 * `algorithms` option defaults to only allow `RS256` to avoid algorithm
 * confusion attacks. Callers may pass additional `VerifyOptions` when
 * needed. Resolves with a `Token` instance on success.
 */
/**
 * Verify token offline using a public certificate.
 * Defaults to `RS256` algorithm allowed list for safety.
 * @param accessToken - JWT string to be verified
 * @param cert - Public certificate or key used for verification
 * @param options - Optional jsonwebtoken VerifyOptions
 * @returns A Promise resolving to a `Token` instance if verification succeeds
 */
/**
 * Verify token offline using a public certificate.
 * Defaults to `RS256` algorithm allowed list for safety.
 *
 * @param accessToken - JWT string to be verified
 * @param cert - Public certificate or key used for verification
 * @param options - Optional jsonwebtoken VerifyOptions
 * @returns A Promise resolving to a `Token` instance if verification succeeds
 * @throws {Error} When verification fails (signature mismatch or invalid token)
 * @example
 * const token = await jwt.verifyOffline('ey...', pubKey)
 */
async verifyOffline(accessToken: string, cert: any, options?: VerifyOptions): Promise<Token>

After

/**
 * Verify token offline using a public certificate.
 * Defaults to `RS256` algorithm allowed list for safety.
 *
 * @param accessToken - JWT string to be verified
 * @param cert - Public certificate or key used for verification
 * @param options - Optional jsonwebtoken VerifyOptions
 * @returns A Promise resolving to a `Token` instance if verification succeeds
 * @throws {Error} When verification fails (signature mismatch or invalid token)
 * @example
 * const token = await jwt.verifyOffline('ey...', pubKey)
 */
async verifyOffline(accessToken: string, cert: any, options?: VerifyOptions): Promise<Token>

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: jkyberneees <4096860+jkyberneees@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on unit and integration tests for Keycloak functionality Remove duplicate JSDoc comments in Jwt.ts Nov 23, 2025
Copilot AI requested a review from jkyberneees November 23, 2025 14:34
@jkyberneees jkyberneees marked this pull request as ready for review November 23, 2025 14:35
@jkyberneees jkyberneees merged commit 41b3b9e into v5.1 Nov 23, 2025
@jkyberneees jkyberneees deleted the copilot/sub-pr-20 branch November 23, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants