Skip to content

Commit be67e88

Browse files
committed
feat: stub secrets API endpoints
This commit introduces a stub of the secrets management API to the Kubeflow Notebooks workspace backend. It is intended to bootstrap API development but will require follow up work to actually implement the business logic in line with the API proposal. **API Endpoints Added:** - GET /api/v1/secrets/{namespace} - List all secrets in namespace - POST /api/v1/secrets/{namespace} - Create new secret - GET /api/v1/secrets/{namespace}/{name} - Get specific secret details - PUT /api/v1/secrets/{namespace}/{name} - Update existing secret - DELETE /api/v1/secrets/{namespace}/{name} - Delete secret **Key Features:** - Complete data models for secret operations (create, update, list, detail) - Comprehensive validation for secret keys and base64-encoded values - Full Swagger/OpenAPI documentation generation - Integration with existing authentication and authorization middleware - Support for secret mounting information and audit trails - Proper error handling and HTTP status codes **Known Omissions:** - No repository/ support for the stubbed API implementations - API serves mocked data for all requests and does not actually interact k8s cluster - Unit tests are very crude and presently rely on mocked data - Missing business logic for majority of API handlers This implementation provides the foundation for frontend integration to manage Kubernetes secrets through the workspace interface. Signed-off-by: Andy Stoneberg <astonebe@redhat.com>
1 parent 5775b5d commit be67e88

File tree

12 files changed

+2501
-0
lines changed

12 files changed

+2501
-0
lines changed

workspaces/backend/api/app.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ const (
6060
// namespaces
6161
AllNamespacesPath = PathPrefix + "/namespaces"
6262

63+
// secrets
64+
AllSecretsPath = PathPrefix + "/secrets/:" + NamespacePathParam
65+
SecretsByNamePath = AllSecretsPath + "/:" + ResourceNamePathParam
66+
6367
// swagger
6468
SwaggerPath = PathPrefix + "/swagger/*any"
6569
SwaggerDocPath = PathPrefix + "/swagger/doc.json"
@@ -112,6 +116,13 @@ func (a *App) Routes() http.Handler {
112116
// namespaces
113117
router.GET(AllNamespacesPath, a.GetNamespacesHandler)
114118

119+
// secrets
120+
router.GET(AllSecretsPath, a.GetSecretsHandler)
121+
router.POST(AllSecretsPath, a.CreateSecretHandler)
122+
router.GET(SecretsByNamePath, a.GetSecretHandler)
123+
router.PUT(SecretsByNamePath, a.UpdateSecretHandler)
124+
router.DELETE(SecretsByNamePath, a.DeleteSecretHandler)
125+
115126
// workspaces
116127
router.GET(AllWorkspacesPath, a.GetAllWorkspacesHandler)
117128
router.GET(WorkspacesByNamespacePath, a.GetWorkspacesByNamespaceHandler)

0 commit comments

Comments
 (0)