Skip to content

feat: classify authentication failure scopes#42

Merged
rdlabo merged 3 commits into
mainfrom
feat/auth-failure-scope
Jul 26, 2026
Merged

feat: classify authentication failure scopes#42
rdlabo merged 3 commits into
mainfrom
feat/auth-failure-scope

Conversation

@rdlabo

@rdlabo rdlabo commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • parse explicit identity, reauthentication, and credential scopes from HTTP 401 bodies
  • pass the complete HttpErrorResponse to 401/403 hooks without breaking existing callbacks
  • retain the legacy revoke-on-401/403 default when applications do not opt into strict classification

Validation

  • npx ng test kit --watch=false (518 tests)
  • npm run prebuild:kit
  • npm run lint
  • formatting and diff checks

Note: the repository-wide npm test also tries to build the demo before its sibling libraries and exits on unresolved demo path aliases; the kit project test passes independently.

@netlify

netlify Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploy Preview for rdlabo-ionic-angular-library ready!

Name Link
🔨 Latest commit d5ef5ab
🔍 Latest deploy log https://app.netlify.com/projects/rdlabo-ionic-angular-library/deploys/6a65874a30840f0008e122ab
😎 Deploy Preview https://deploy-preview-42--rdlabo-ionic-angular-library.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@rdlabo
rdlabo marked this pull request as ready for review July 26, 2026 04:09
@rdlabo
rdlabo merged commit ab210fc into main Jul 26, 2026
12 checks passed

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

Open in Devin Review

credential: 'credential',
} as const;

export type AuthFailureScope = (typeof AUTH_FAILURE_SCOPES)[keyof typeof AUTH_FAILURE_SCOPES];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 公開型にドキュメントコメントが付いていない

公開APIとして公開される型 AuthFailureScopeprojects/kit/src/lib/http/auth-failure.ts:13)にJSDocコメントが付いていないため、リポジトリの必須ルールに違反しています。
Impact: ライブラリ利用者向けのAPIドキュメントが欠落します。

リポジトリ規約違反の内訳

AGENTS.mdの「Every public class, function, and type must have a JSDoc comment.」および同一リポジトリの既存慣習(projects/kit/src/lib/auth/auth-access.service.ts:5-6KitAuthAccessMode などは全てJSDoc付き)に反し、export type AuthFailureScope にJSDocがありません。public-api.ts 経由で公開されます。

Suggested change
export type AuthFailureScope = (typeof AUTH_FAILURE_SCOPES)[keyof typeof AUTH_FAILURE_SCOPES];
/** Lifecycle scope of an authentication failure, parsed from the response body. */
export type AuthFailureScope = (typeof AUTH_FAILURE_SCOPES)[keyof typeof AUTH_FAILURE_SCOPES];
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


export type AuthFailureScope = (typeof AUTH_FAILURE_SCOPES)[keyof typeof AUTH_FAILURE_SCOPES];

export const AUTH_IDENTITY_INVALID_CODE = 'AUTH_IDENTITY_INVALID';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 公開定数にドキュメントコメントが付いていない

公開APIとして公開される定数 AUTH_IDENTITY_INVALID_CODEprojects/kit/src/lib/http/auth-failure.ts:15)にJSDocコメントが付いていないため、リポジトリの必須ルールおよび既存慣習に違反しています。
Impact: ライブラリ利用者向けのAPIドキュメントが欠落します。

リポジトリ規約違反の内訳

同ファイルの AUTH_FAILURE_SCOPESprojects/kit/src/lib/http/auth-failure.ts:7)や auth-access.service.ts:57-58 の公開定数はいずれもJSDoc付きであり、公開定数にドキュメントを付ける慣習が確立しています。AUTH_IDENTITY_INVALID_CODE のみ欠落しています。

Suggested change
export const AUTH_IDENTITY_INVALID_CODE = 'AUTH_IDENTITY_INVALID';
/** Body `code` that must accompany an `identity` scope to revoke global access. */
export const AUTH_IDENTITY_INVALID_CODE = 'AUTH_IDENTITY_INVALID';
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


export const AUTH_IDENTITY_INVALID_CODE = 'AUTH_IDENTITY_INVALID';

export interface AuthFailureBody {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 公開インターフェースにドキュメントコメントが付いていない

公開APIとして公開されるインターフェース AuthFailureBodyprojects/kit/src/lib/http/auth-failure.ts:17)にJSDocコメントが付いていないため、リポジトリの必須ルールに違反しています。
Impact: ライブラリ利用者向けのAPIドキュメントが欠落します。

リポジトリ規約違反の内訳

AGENTS.mdの「Every public class, function, and type must have a JSDoc comment.」に反し、export interface AuthFailureBody にJSDocがありません。auth-access.service.ts:8-9,40-41 の公開インターフェースは全てJSDoc付きです。

Suggested change
export interface AuthFailureBody {
/** Shape of an authentication failure response body carrying an explicit scope. */
export interface AuthFailureBody {
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

1 participant