Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ai-services/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,12 @@ const docTemplate = `{
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"403": {
"description": "User doesn't own this application",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"404": {
"description": "Application or datasource not found",
"schema": {
Expand Down Expand Up @@ -633,6 +639,12 @@ const docTemplate = `{
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"403": {
"description": "User doesn't own this application",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"404": {
"description": "Datasource not connected to this application",
"schema": {
Expand Down
12 changes: 12 additions & 0 deletions ai-services/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,12 @@
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"403": {
"description": "User doesn't own this application",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"404": {
"description": "Application or datasource not found",
"schema": {
Expand Down Expand Up @@ -627,6 +633,12 @@
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"403": {
"description": "User doesn't own this application",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"404": {
"description": "Datasource not connected to this application",
"schema": {
Expand Down
8 changes: 8 additions & 0 deletions ai-services/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,10 @@ paths:
description: Unauthorized
schema:
$ref: '#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse'
"403":
description: User doesn't own this application
schema:
$ref: '#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse'
"404":
description: Application or datasource not found
schema:
Expand Down Expand Up @@ -1400,6 +1404,10 @@ paths:
description: Unauthorized
schema:
$ref: '#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse'
"403":
description: User doesn't own this application
schema:
$ref: '#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse'
"404":
description: Datasource not connected to this application
schema:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,24 @@ func (h *ApplicationHandler) ListApplications(c *gin.Context) {
return
}

// Extract user ID from auth context
userID := c.GetString(middleware.CtxUserIDKey)
if userID == "" {
c.JSON(http.StatusUnauthorized, ErrorResponse{
Error: "Unauthorized: user ID not found in context",
})

return
}
Comment thread
mkumatag marked this conversation as resolved.
Resolved

// Build request
req := repository.ListApplicationsRequest{
Page: page,
PageSize: pageSize,
DeploymentType: deploymentType,
CatalogID: catalogID,
Search: search,
CreatedBy: userID,
}

// Call service layer
Expand Down
Loading
Loading