ワークスペースユーザーAPI公開対応#277
Merged
Merged
Conversation
94d2854 to
22dbd9c
Compare
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.
サマリ
概要、背景
公開 API(アクセストークン認証)の Workspace User エンドポイントに、Python SDK を対応させる。
追加された API:
GET /workspaces-users— 内部ワークスペースユーザー一覧POST /workspaces-users/internal-users— ユーザー追加(slug はサーバー側で自動生成)PUT /workspaces-users/internal-users/{id}— role・モジュール権限の更新DELETE /workspaces-users/internal-users/{id}— ユーザー削除あわせて、招待・更新時にモジュール権限(
functionResourcePermissions)を付与・同期する対応も含む。
(不具合の場合のみ) 発生原因
N/A(機能追加)
対応内容
やったこと
fastlabel/__init__.pyのClientに 4 メソッドを追加get_workspace_users(keyword, offset, limit)— レスポンスにfunctionResourcePermissionsを含むcreate_workspace_user(name, email, language, role, modules=None)update_workspace_user(user_id, role=None, modules=None)delete_workspace_user(user_id)modules("annotation" | "modelDev" | "dataset")に対応None=変更なし /[]=全剥奪 をis not Noneで区別して送信README.mdに Workspace User セクションを追加(引数・レスポンス例・modules の挙動)tests/test_workspace_user.pyを新規追加(endpoint / params / payload の検証、11 ケース)やれていないこと、妥協点
UI/UX
before
N/A(SDK のため UI なし)
after
N/A
テスト
変更の意図に沿った基本動作が確認できている
tests/test_workspace_user.pyが全件パス(pytest tests/test_workspace_user.py→ 11 passed)関連する既存機能にデグレがないことを確認
pytest)エッジケースや例外パターンの動作を確認
関連リンク
補足