Feat add artefact group endpoints#55
Open
bedwards-ibm wants to merge 2 commits intomainfrom
Open
Conversation
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.
Add Artifact Sharing Visibility Endpoints
Summary
This PR adds two new REST API endpoints that provide visibility into artifact-group sharing relationships, enabling users to discover which groups have access to artifacts and what artifacts are shared with their groups.
Motivation
Previously, users could share artifacts with groups but had no way to:
These endpoints address this gap by providing comprehensive visibility into sharing relationships.
Changes
New Endpoints
1. List Groups for an Artifact
GET /v2/artifacts/{artifact_type}/{artifact_id}/groupsReturns all groups that have access to a specific artifact.
Authorization:
Example Response:
[ { "group_id": "550e8400-e29b-41d4-a716-446655440000", "group_name": "Data Science Team", "granted_by": "owner@example.com", "granted_at": "2026-05-01T10:30:00Z", "user_role": "member" } ]2. List Artifacts Shared with a Group
GET /v2/groups/{group_id}/artifacts(all types)GET /v2/groups/{group_id}/artifacts/{artifact_type}(filtered by type)Returns all artifacts shared with a group, with optional filtering by artifact type.
Authorization:
Query Parameters:
limit: Maximum results (default: 100, max: 1000)offset: Pagination offset (default: 0)Example Response:
{ "total": 25, "limit": 100, "offset": 0, "artifacts": [ { "artifact_id": "dataset-123", "artifact_type": "dataset", "artifact_name": "Satellite Imagery 2026", "granted_by": "owner@example.com", "granted_at": "2026-05-01T10:30:00Z", "created_by": "owner@example.com", "created_at": "2026-04-15T08:00:00Z" } ] }Files Modified
gfmstudio/groups/schemas.pyGroupSharingInfoschema for group sharing detailsArtifactSharingDetailschema for artifact detailsArtifactSharingListResponseschema for paginated responsesgfmstudio/groups/api.pyartifacts_routerfor artifact-centric endpointslist_artifact_groups()endpoint_list_group_artifacts_impl()functionlist_group_artifacts_all()endpoint (no filter)list_group_artifacts_by_type()endpoint (with filter)gfmstudio/main.pyartifacts_routerwith/v2prefixTechnical Details
Authorization Model
Performance Optimizations
ArtifactPermissiontableError Handling
ID Type Compatibility
_convert_artifact_id_for_query()helperUsage Examples
Check which groups can access a dataset
List all artifacts shared with a group
List only models shared with a group
Backward Compatibility
✅ No breaking changes
Database Impact
✅ No migrations required
ArtifactPermission,Group, andGroupMembertablesTesting
The implementation includes comprehensive error handling and follows existing patterns:
_require_group_member,_convert_artifact_id_for_query)ARTIFACT_TYPE_TO_MODELmappingDocumentation
docs/artifact_sharing_endpoints_plan.mdIMPLEMENTATION_SUMMARY.mdMIGRATION_INSTRUCTIONS.md(for unrelated pre-existing issue)Future Enhancements
Potential follow-up improvements:
granted_byusergranted_atResolves: Request for artifact sharing visibility endpoints
Type: Feature
Breaking Change: No
Database Migration: No