OMDSCloud/dictation_client
makabe.t e4f84f78ba Merged PR 121: リフレッシュトークンの発行方法・発行内容が不適切な問題の修正
## 概要
[Task1904: リフレッシュトークンの発行方法・発行内容が不適切な問題の修正](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/1904)

セキュリティ・権限管理の要であるリフレッシュトークンのロール設定に関する修正ですので、開発メンバー全員にご確認いただき、変更内容について認識を合わせていただきたいです。
- リフレッシュトークンの発行で使用するロールがクライアントから送られた値をそのまま利用する実装になっていましたので、APIのロールの取り扱いを修正しました
  - ユーザー追加APIで想定している(author/typist/none)のみを受け付けるようにする
    - 想定外のロールの場合は400エラー
    - クライアントからも想定通りのロールを送信するようロールの定数値を修正
  - リフレッシュトークンを発行する際にDBの値をそのまま使わず、想定値のどれかを判断して定数を設定する
    - DBに登録されているロールが想定外の文字列の場合は500エラーとなる

## レビューポイント
- トークンのロール設定が安全にできるようになっていることをメンバー全員で合意
- APIのパラメータを受け付ける際にIsInで想定ロール文字列のみを受け付けるようにしているが問題はないか
- リフレッシュトークンの生成時に直接DBのロールを設定しないようにしたが、トークンのロール設定として問題はないか
  - 意図しないトークンへの権限の付与などは起こりえないか。
    - クライアントからadminなどのユーザー追加時に想定していない権限を付与しようとしてもAPIではじかれるか

## UIの変更
- なし

## 動作確認状況
- ローカルで確認

## 補足
- ユーザー追加時に登録されるロールが変更となったのでマージ後に利用する場合は再度の登録をお願いします。
2023-06-02 04:55:28 +00:00
..
2023-03-08 10:52:30 +09:00

Getting Started with Create React App

This project was bootstrapped with Create React App, using the Redux and Redux Toolkit TS template.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3001 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

npm run eject

Note: this is a one-way operation. Once you eject, you cant go back!

If you arent satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.

You dont have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.