Support for Non-401 Error Codes from the validateFunc
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, node.js
調査の方向性
まず cookie plugin の validateFunc の処理を読み、issue で説明されている @hapi/basic の validate の動作と比較します。要求されたリージョンに対して無効な cookie について、検証が 401 ではない Boom エラー(たとえば 403 Forbidden)を返せるようになり、レスポンスステータスを対象とするテストが追加されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Support plan
- is this issue currently blocking your project? (yes/no): No
- is this issue affecting a production system? (yes/no): No
Context
- node version:
v14.17.0 - module version:
11.0.2 - environment (e.g. node, browser, native): Node
- used with (e.g. hapi application, another framework, standalone, ...): Hapi application (Hapi version =
20.2.1) - any other relevant information:
What problem are you trying to solve?
I have a system that involves multiple different "regions" of authorization, I want a cookie to only be valid for one of these "regions", and I have added validation checks into the validateFunc. I would love be able to respond to the client with a 403 Forbidden when the cookie provided is for a different "region" than that which it is trying to access.
Example:
I have "regions" 1 and 2, and an authorization cookie is used for region 1, but the user is making a request to GET /region/2 I would like to be able to throw boom.forbidden(), and it set the response code to 403 instead of the plugin only throwing 401 to the user.
Do you have a new or modified API suggestion to solve the problem?
I think a solution following a similar vein as to how @hapi/basic does it where if the validateFunc throws an error(/Boom error) it replaces the default boom.unauthorized()
From the @hapi/basic API documentation for the validate function:
- Throwing an error from this function will replace default
Boom.unauthorizederror
- 主要言語
- JavaScript
- スター
- 229
- フォーク
- 99
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
hapijs/cookie のほかの issue
-
support
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
ttl和keepAlive功能存在bugオープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
-
support
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
support
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
-
support
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
obsidianmd/obsidian-help#1169 ·
メンテナーはふだん 2 日以内に返信
-
[docs] RELEASE.md: wrong branch name, no check that the prepare PR merged with the right subject, manual publish step対応中かも @albertteoh が今日担当しました。 オープンdocumentation
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
jaegertracing/jaeger-ui#4739 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
keepassxreboot/keepassxc-browser#3159 · コメント 1 件 ·
-
Add: ESP 2 RSオープンapproved check:passed feeds:add
難易度 1/5 1時間未満 初心者へのやさしさ 67/100