Repository navigation
機関管理者の適切な権限機能のテスト追加 - #61
Draft
lieunguyen-tma wants to merge 6 commits into
Draft
lieunguyen-tma wants to merge 6 commits into
lieunguyen-tma wants to merge 6 commits into
Conversation
… api authorization
…admin_api_authorization
lieunguyen-tma
marked this pull request as draft
November 4, 2026 02:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
機関管理者の適切な権限機能に対するテストケースを追加する。
Changes
本PRの変更を「(1) 機関管理者の適切な権限テスト本体」と「(2) それをCIで実行するための共有CI基盤の修正」に分けて記載する。
(1) 機関管理者の適切な権限テスト本体(本リポジトリ内のみ/共有CIへの影響なし)
機関管理者の適切な権限機能のテスト手順を追加し、実行可能にするための変更。
テスト手順-管理者機能-機関管理者の適切な権限-未ログイン.ipynbを追加。主なテスト内容:未ログインユーザが統合管理者向け、機関管理者向けのページにアクセスできないことを確認。テスト手順-管理者機能-機関管理者の適切な権限-機関管理者.ipynbを追加。主なテスト内容:機関管理者のアクセス制御を確認。テスト手順-管理者機能-機関管理者の適切な権限-統合管理者.ipynbを追加。主なテスト内容:統合管理者のアクセス制御を確認。テスト手順-管理者機能-機関管理者の適切な権限-クリーンアップ処理.ipynbを追加。主なテスト内容:テスト実行後のデータクリーンアップ処理。取りまとめ-管理者機能-機関管理者の適切な権限.ipynbを追加。CI・手動実行のエントリポイントとして上記全テストノートブックをrun_notebookで順次実行する。必要なパラメータ(admin_rdm_url、統合管理者/機関管理者認証情報、user_guid、各プロバイダー名等)をすべて受け取る。結合試験-実行.ipynb:institutional_admin_authorization_enabledフラグおよびcas_rdm_url、idp_username_integrated_admin_2/idp_password_integrated_admin_2、user_guid、user_name、integrated_admin_user_name、各プロバイダー名パラメータを追加し、取りまとめ-管理者機能-機関管理者の適切な権限.ipynbの run_notebook 実行セルを追加。(2) 機関管理者の適切な権限テストをCIで実行するための共有CI基盤の修正
(2-a) テストユーザー追加・プロバイダーデータ作成 —
setup_test_data.pyの修正[email protected](fullname: Test User 7、is_superuser: True)を新規追加。統合管理者2としての動作確認用ユーザーのためプロジェクトは事前作成しない(skip_project: true)。INSTITUTIONAL_ADMIN_AUTHORIZATION_ENABLED=trueの場合のみ、以下のプロバイダー・データを作成(冪等性確保):RegistrationProvider(_id: osf,name: OSF Registries)を作成し、testuser2のプロジェクトにリンクしたレジストレーションを1件作成。PreprintProvider(_id: osf,name: Open Science Framework)を作成し、testuser2のプリプリントを1件作成。CollectionProvider(_id: idtest,name: OSF Collection)および primary_collection を作成し、testuser2のプロジェクトをコレクションに登録。[email protected]: <guid>をstdoutに出力。(2-b) 新テストグループ追加・フラグ追加 —
e2e-test.ymlの修正institutional_admin_authorization_enabledフィールドを追加(既存グループはすべてfalse)。admin-institutional-admin-authorization(Display: "Admin Tests (Institutional Admin Authorization)")を追加。include_admin: true、institutional_admin_authorization_enabled: true、その他テスト(admin/metadata/login/upload/MinIO/WEKO/Mibyo DB/JupyterHub/Flowable/Wiki)はすべてスキップ設定。機関管理者の適切な権限テストのみを実行する専用グループ。INSTITUTIONAL_ADMIN_AUTHORIZATION_ENABLED環境変数をmatrix.test-group.institutional_admin_authorization_enabledから解決してenv:ブロックに追加。docker-compose execコマンドへ-e INSTITUTIONAL_ADMIN_AUTHORIZATION_ENABLED="${INSTITUTIONAL_ADMIN_AUTHORIZATION_ENABLED}"を追加(setup_test_data.pyに環境変数を渡すため)。USER_GUIDをsetupスクリプト出力から抽出しGITHUB_ENVにエクスポート。INSTITUTIONAL_ADMIN_AUTHORIZATION_ENABLED=trueかつUSER_GUIDが空の場合はエラー終了。run_tests.py呼び出し時にinstitutional_admin_authorization_enabled: ${{ matrix.test-group.institutional_admin_authorization_enabled == true }}を追加。run_tests.py呼び出しに追加(idp_username_integrated_admin_2、idp_password_integrated_admin_2)。INSTITUTIONAL_ADMIN_AUTHORIZATION_ENABLED=trueの場合のみ、user_guid、user_name、integrated_admin_user_name、registration_provider_name、preprint_provider_name、collection_provider_nameを config に追加。(2-c) 全テスト共通CIエントリポイントの修正 —
run_tests.pyの修正run_institutional_admin_authorization_tests()メソッドを新規追加。institutional_admin_authorization_enabled=trueの場合のみ取りまとめ-管理者機能-機関管理者の適切な権限.ipynbを実行し、必要なパラメータ(admin_rdm_url、idp_name/username/password_integrated_admin、idp_username/password_integrated_admin_2、integrated_admin_user_name、idp_name/username/password_institutional_admin、user_guid、user_name、各プロバイダー名)を伝播する。既存のテスト実行メソッドには手を加えておらず、既存テストグループのCIフローへの影響はない。institutional_admin_authorization_enabled、user_guid、user_name、registration_provider_name、preprint_provider_name、collection_provider_name、idp_username_integrated_admin_2、idp_password_integrated_admin_2、integrated_admin_user_nameを追加。Note
CI の環境(IdP が
FakeCAS)の場合、次の手順は実行されずに通過します。CI が成功していても、これらの手順は確認されていません。/Shibboleth.sso/Status(管理画面・cas)/password/recover・/password/recover/<signature>/password/reset/<token>(GET・POST)・/password/reset/done/account/login(POST)/admin/login(GET・POST)/statistics/test/mail実施による影響とクリーンアップ
試験の実施により以下の変更が行われる。クリーンアップ処理で元に戻るものと、戻らないものを以下に記載する。
Ticket
60922
Custom Test Configuration