moltzaum opened a new pull request #2704: TO DB - Mapping roles to capabilities 
for read-only, operations, portal, federations, steering
URL: https://github.com/apache/trafficcontrol/pull/2704
 
 
   #### What does this PR do?
   
   This PR is a database migration that assigns capabilities for the roles:
   - `read-only`
   - `operations`
   - `portal`
   - `federations`
   - `steering`
   
   It does not map anything for the ort role.
   
   Fixes: #xxxx (couldn't find)
   Related: #2038
   
   Traffic Ops is the only affected component, except the changes only exist in 
the database and are not used yet functionally.
   
   #### What is the best way to verify this PR?
   
   Run the migrations, check the summary, and check the contents of the 
database.
   
   #### Check all that apply
   
   - [ ] This PR includes tests
   - [ ] This PR includes documentation updates
   - [ ] This PR includes an update to CHANGELOG.md
   - [x] This PR includes all required license headers
   - [x] This PR does *NOT* fix a serious security flaw. Read more: 
[www.apache.org/security](http://www.apache.org/security/)
   
   ------
   
   #### Summary:
   - admin
     - all capabilities
   - read-only
     - all reads
   - operations
     - has all read-only
     - has a majority of write capabilities
   - portal
     - has all read-only
     - has a few writes
   - steering
     - limited scope
   - federations
     - limited scope
   - disallowed
     - no capabilities
   
   #### Note:
     Every role except for 'disallowed' has the auth capability.
   
   #### Things to address in separate PRs:
   
   1) The ort role does not seem to be in use, however we should make a role to 
support it.
   
   2) Internals:
     internal/api/$version/cdns/dnsseckeys/refresh
     internal/api/$version/steering
     internal/api/$version/steering/:xml_id (GET)
     internal/api/$version/steering/:xml_id (PUT)
     internal/api/$version/federations
     internal/api/$version/daily_summary
     internal/api/$version/current_stats
   
   All of these endpoints currently exist in the api_capability table, except 
'internal/api/$version' has been removed. Due to how the internal information 
is stripped, `internal/api/$version/federations` is indistinguishable from 
`api/$version/federations`. I think there might need to be some sort of boolean 
indicating an internal api endpoint.
   
   3) Manual capability checks in code: (#2488)
     `params-write` contains an endpoint that will need to check for the 
currently non-existent capability `params-secure-write` as a manual check in 
the code. As a side note, I think `params-write` should be changed to 
`parameters-write`
   
   #### Relevant commit history:
   
   Migrate GET cdns/*/snapshot to use cdns-snapshot capability instead of 
cdns-read
   
   Saved Progress. Moved some things around and trimmed a little. To finish 
trimming steering a reseed is required, so I am squashing commits.
   
   Added steering-read, steering-write, and steering-targets-read capabilities
   
   <!--
       Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you under the Apache License, Version 2.0 (the
       "License"); you may not use this file except in compliance
       with the License.  You may obtain a copy of the License at
   
         http://www.apache.org/licenses/LICENSE-2.0
   
       Unless required by applicable law or agreed to in writing,
       software distributed under the License is distributed on an
       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
       KIND, either express or implied.  See the License for the
       specific language governing permissions and limitations
       under the License.
   -->
   
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to