Skip to content

Commit

Permalink
Finishing manual merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mtesseract committed Aug 8, 2022
1 parent a70feee commit 2be6b60
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 67 deletions.
6 changes: 3 additions & 3 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@
"filename": "openapi/fleet-manager-private.yaml",
"hashed_secret": "2774b5ad0fae1c8b8dc897b89db85529d45cb5cf",
"is_verified": false,
"line_number": 472,
"line_number": 474,
"is_secret": false
}
],
Expand All @@ -503,7 +503,7 @@
"filename": "openapi/fleet-manager.yaml",
"hashed_secret": "a5f0056c7d0ca4ed78e2f3b551554daaf4721934",
"is_verified": false,
"line_number": 1037,
"line_number": 1094,
"is_secret": false
}
],
Expand Down Expand Up @@ -834,5 +834,5 @@
}
]
},
"generated_at": "2022-08-05T01:18:11Z"
"generated_at": "2022-08-08T08:04:27Z"
}
9 changes: 9 additions & 0 deletions dev/env/manifests/shared/03-configmap-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ data:
roles:
- "acs-general-engineering" # Will include all of ACS engineering. Available also within staging environment.
- "acs-fleet-manager-admin-full" # Prod rover group, will only include selected members + SREs.
- method: POST
roles:
- "acs-general-engineering" # Will include all of ACS engineering. Available also within staging environment.
- "acs-fleet-manager-admin-full" # Prod rover group, will only include selected members + SREs.
- "acs-fleet-manager-admin-write" # Prod rover group, will only include selected members + SREs.
admin-authz-roles-prod.yaml: |-
---
- method: GET
Expand All @@ -246,6 +251,10 @@ data:
- method: DELETE
roles:
- "acs-fleet-manager-admin-full" # Prod rover group, will only include selected members + SREs.
- method: POST
roles:
- "acs-fleet-manager-admin-full" # Prod rover group, will only include selected members + SREs.
- "acs-fleet-manager-admin-write" # Prod rover group, will only include selected members + SREs.
kind: ConfigMap
metadata:
name: config
Expand Down
7 changes: 0 additions & 7 deletions internal/dinosaur/pkg/routes/route_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,6 @@ func (s *options) buildAPIBaseRouter(mainRouter *mux.Router, basePath string, op

adminDinosaurHandler := handlers.NewAdminDinosaurHandler(s.Dinosaur, s.AccountService, s.ProviderConfig)
adminRouter := apiV1Router.PathPrefix("/admin").Subrouter()
// TODO(ROX-11683): For now using RH SSO issuer for the admin API, but needs to be re-visited within this ticket.
// rolesMapping := map[string][]string{
// http.MethodGet: {auth.FleetManagerAdminReadRole, auth.FleetManagerAdminWriteRole, auth.FleetManagerAdminFullRole},
// http.MethodPost: {auth.FleetManagerAdminWriteRole, auth.FleetManagerAdminFullRole},
// http.MethodPatch: {auth.FleetManagerAdminWriteRole, auth.FleetManagerAdminFullRole},
// http.MethodDelete: {auth.FleetManagerAdminFullRole},
// }

// TODO(ROX-11683): For now using RH SSO issuer for the admin API, but needs to be re-visited within this ticket.
adminRouter.Use(auth.NewRequireIssuerMiddleware().RequireIssuer(
Expand Down
56 changes: 0 additions & 56 deletions openapi/fleet-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,62 +197,6 @@ paths:
summary: Deletes a Central request by ID
security:
- Bearer: []
patch:
summary: Update a Central instance by id
description: |
The only users authorized for this operation are:
1) The administrator of the owner organisation of the specified Central.
2) The owner user, and only if it is also part of the owner organisation of the specified Central.
security:
- Bearer: []
operationId: updateCentralById
requestBody:
description: Update owner of Cental
content:
application/json:
schema:
$ref: "#/components/schemas/CentralUpdateRequest"
required: true
responses:
"200":
description: Cental updated by ID
content:
application/json:
schema:
$ref: "#/components/schemas/CentralRequest"
examples:
CentralRequestPostResponseExample:
$ref: "#/components/examples/CentralRequestExample"
"400":
description: Bad request
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"401":
description: Auth token is invalid
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"403":
description: User is not authorised to access the service
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"404":
description: No Central found with the specified ID
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"500":
description: Unexpected error occurred
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
parameters:
- $ref: "#/components/parameters/id"
/api/rhacs/v1/centrals:
Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/roles_authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func readRoleAuthZConfigFile(file string, val *RoleConfig) error {
return nil
}

var allowedHTTPMethods = []string{http.MethodGet, http.MethodPatch, http.MethodDelete}
var allowedHTTPMethods = []string{http.MethodGet, http.MethodPatch, http.MethodDelete, http.MethodPost}

func validateRolesConfiguration(configs []RolesConfiguration) error {
for _, config := range configs {
Expand Down

0 comments on commit 2be6b60

Please sign in to comment.