This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 86
[WIP] permissions API #2246
Open
stooke
wants to merge
81
commits into
fabric8-services:master
Choose a base branch
from
stooke:jst-perms2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[WIP] permissions API #2246
Changes from 51 commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
b6fcaba
Eliminate some more duplicate names for deployments API refactoring
stooke 36e590a
Merge remote-tracking branch 'upstream/master'
stooke 58342c7
Merge remote-tracking branch 'upstream/master'
stooke a45161a
Merge remote-tracking branch 'upstream/master'
stooke dbcf947
Merge remote-tracking branch 'upstream/master'
stooke 99d3f01
remove unused /apps API
stooke e45ac78
Merge remote-tracking branch 'upstream/master'
stooke 2b06816
Merge remote-tracking branch 'upstream/master'
stooke 94159dc
Merge remote-tracking branch 'upstream/master'
stooke 9bb38c8
Merge remote-tracking branch 'upstream/master'
stooke ad3b87f
Merge remote-tracking branch 'upstream/master'
stooke e32a323
Merge remote-tracking branch 'upstream/master'
stooke 1a9481d
Merge remote-tracking branch 'upstream/master'
stooke ff47976
Merge remote-tracking branch 'upstream/master'
stooke 29461ed
Merge remote-tracking branch 'upstream/master'
stooke 15ee913
Merge remote-tracking branch 'upstream/master'
stooke 7df6871
Merge remote-tracking branch 'upstream/master'
stooke f9a252e
Merge remote-tracking branch 'upstream/master'
stooke 99f3d57
Merge remote-tracking branch 'upstream/master'
stooke 8193a2f
Merge remote-tracking branch 'upstream/master'
stooke 7ebe5eb
Merge remote-tracking branch 'upstream/master'
stooke d1514f0
Merge remote-tracking branch 'upstream/master'
stooke d2eb5e3
Merge remote-tracking branch 'upstream/master'
stooke 63c3ec9
Merge remote-tracking branch 'upstream/master'
stooke fa0d3bd
Merge remote-tracking branch 'upstream/master'
stooke 2418c94
Merge remote-tracking branch 'upstream/master'
stooke 7a7c9e8
Merge remote-tracking branch 'upstream/master'
stooke e4c3a6c
Merge remote-tracking branch 'upstream/master'
stooke e2b0461
Merge remote-tracking branch 'upstream/master'
stooke 38e5982
Merge remote-tracking branch 'upstream/master'
stooke 270268d
Merge remote-tracking branch 'upstream/master'
stooke 58929c0
Merge remote-tracking branch 'upstream/master' into jst-perms2
stooke 8d58119
new auth JSON API code prototype
stooke 3d9ebdb
Merge remote-tracking branch 'upstream/master' into jst-perms2
stooke 57dd758
Merge remote-tracking branch 'upstream/master' into jst-perms2
stooke d8c553e
Initial implementation of OpenShift authz checking
ebaron bd04f78
Remove unused interactions in delete cassettes
ebaron a768678
Add CanDeploy to filter deployable environments, maintain full list i…
ebaron 5136927
Implement authz check for DeleteDeployment
ebaron 9fd101e
Implement remaining methods, add tests for access control failure on …
ebaron 2c42ebc
Fix URLProvider changes, add tests for CanDeploy
ebaron e571140
Better test error conditions
ebaron efe93cd
Clean up code
ebaron 0d756c5
Add more internal environments to kubeclient tests
ebaron d3325c0
Improve documentation, avoid boolean parameter for getting namespace
ebaron 2ae089a
Also check for wildcard rules
ebaron 271c627
added ebaron deployments-check-k8s-auth branch
stooke 34c95bb
move perms to /api/spaces
stooke 39776d0
Merge branch 'master' into deployments-check-k8s-auth
ebaron 23c654e
merge with upstream and ebaron
stooke 4bfae3b
updated from ebaron
stooke e5dd365
Merge remote-tracking branch 'upstream/master' into jst-perms2
stooke afae2f4
Initial implementation of OpenShift authz checking
ebaron 989e036
Remove unused interactions in delete cassettes
ebaron 92d1a87
Add CanDeploy to filter deployable environments, maintain full list i…
ebaron 9e62c5c
Implement authz check for DeleteDeployment
ebaron ec4bad9
Implement remaining methods, add tests for access control failure on …
ebaron f28fce8
Fix URLProvider changes, add tests for CanDeploy
ebaron b814a8a
Better test error conditions
ebaron adbb22c
Clean up code
ebaron 8ea65cb
Add more internal environments to kubeclient tests
ebaron 9d34f9f
Improve documentation, avoid boolean parameter for getting namespace
ebaron 9b5b770
Also check for wildcard rules
ebaron ad29c04
Reduce size of go-vcr cassettes
ebaron 86eaae2
working paerms - no tests
stooke 8375f46
Merge remote-tracking branch 'ebaron/deployments-check-k8s-auth' into…
stooke 8231adf
fixed unit tests
stooke d3fe4c4
Merge remote-tracking branch 'upstream/master' into jst-perms2
stooke c904053
get rid of some test files
stooke 03e3aa0
Merge remote-tracking branch 'upstream/master' into jst-perms2
stooke ed803fa
get rid of some test files
stooke 5f64cc5
get rid of debug code
stooke 85236ea
small comment cleanup
stooke 421c6bd
Merge remote-tracking branch 'upstream/master' into jst-perms2
stooke 6e601e8
Merge remote-tracking branch 'upstream/master' into jst-perms2
stooke bfae026
added more deployment stats permission code
stooke 1f459ca
Merge remote-tracking branch 'upstream/master' into jst-perms2
stooke cb9fdb5
Merge remote-tracking branch 'upstream/master' into jst-perms2
stooke 3fe9177
get rid of tostring(), add (broken) test for qp=true
stooke a6aeb73
Merge remote-tracking branch 'upstream/master' into jst-perms2
stooke aa8b1b6
Merge remote-tracking branch 'upstream/master' into jst-perms2
stooke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"data":{"attributes":{"created-at":"2018-07-02T04:00:57.297291Z","description":"","name":"rgarg-osiotest1-AGILE-space-2018-07-02T05-00-57","updated-at":"2018-07-02T04:00:57.297291Z","version":0},"id":"17c1e9de-a89a-494b-91c4-819a013cb3b9","links":{"backlog":{"meta":{"totalCount":46},"self":"https://api.openshift.io/api/spaces/17c1e9de-a89a-494b-91c4-819a013cb3b9/backlog"},"filters":"https://api.openshift.io/api/filters","related":"https://api.openshift.io/api/spaces/17c1e9de-a89a-494b-91c4-819a013cb3b9","self":"https://api.openshift.io/api/spaces/17c1e9de-a89a-494b-91c4-819a013cb3b9","workitemlinktypes":"https://api.openshift.io/api/spacetemplates/f405fa41-a8bb-46db-8800-2dbe13da1418/workitemlinktypes","workitemtypes":"https://api.openshift.io/api/spacetemplates/f405fa41-a8bb-46db-8800-2dbe13da1418/workitemtypes"},"relationships":{"areas":{"links":{"related":"https://api.openshift.io/api/spaces/17c1e9de-a89a-494b-91c4-819a013cb3b9/areas"}},"backlog":{"links":{"related":"https://api.openshift.io/api/spaces/17c1e9de-a89a-494b-91c4-819a013cb3b9/backlog"},"meta":{"totalCount":46}},"codebases":{"links":{"related":"https://api.openshift.io/api/spaces/17c1e9de-a89a-494b-91c4-819a013cb3b9/codebases"}},"collaborators":{"links":{"related":"https://api.openshift.io/api/spaces/17c1e9de-a89a-494b-91c4-819a013cb3b9/collaborators"}},"filters":{"links":{"related":"https://api.openshift.io/api/filters"}},"iterations":{"links":{"related":"https://api.openshift.io/api/spaces/17c1e9de-a89a-494b-91c4-819a013cb3b9/iterations"}},"labels":{"links":{"related":"https://api.openshift.io/api/spaces/17c1e9de-a89a-494b-91c4-819a013cb3b9/labels"}},"owned-by":{"data":{"id":"02227dc6-f4fe-451b-9549-4c5b7becc5e7","type":"identities"},"links":{"related":"https://api.openshift.io/api/users/02227dc6-f4fe-451b-9549-4c5b7becc5e7"}},"space-template":{"data":{"id":"f405fa41-a8bb-46db-8800-2dbe13da1418","type":"spacetemplates"},"links":{"related":"https://api.openshift.io/api/spacetemplates/f405fa41-a8bb-46db-8800-2dbe13da1418","self":"https://api.openshift.io/api/spacetemplates/f405fa41-a8bb-46db-8800-2dbe13da1418"}},"workitemlinktypes":{"links":{"related":"https://api.openshift.io/api/spacetemplates/f405fa41-a8bb-46db-8800-2dbe13da1418/workitemlinktypes"}},"workitems":{"links":{"related":"https://api.openshift.io/api/spaces/17c1e9de-a89a-494b-91c4-819a013cb3b9/workitems"}},"workitemtypegroups":{"links":{"related":"https://api.openshift.io/api/spacetemplates/f405fa41-a8bb-46db-8800-2dbe13da1418/workitemtypegroups"}},"workitemtypes":{"links":{"related":"https://api.openshift.io/api/spacetemplates/f405fa41-a8bb-46db-8800-2dbe13da1418/workitemtypes"}}},"type":"spaces"}} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
.PHONY: dev-pp | ||
dev-pp: prebuild-check deps generate $(FRESH_BIN) docker-compose-up | ||
FABRIC8_WIT_API_URL=https://api.prod-preview.openshift.io F8_CONFIG_FILE_PATH=jstconfig-pp.yaml F8_DEVELOPER_MODE_ENABLED=true $(FRESH_BIN) | ||
|
||
.PHONY: dev-prod | ||
dev-prod: prebuild-check deps generate $(FRESH_BIN) docker-compose-up | ||
FABRIC8_WIT_API_URL=https://api.openshift.io F8_CONFIG_FILE_PATH=jstconfig-prod.yaml F8_DEVELOPER_MODE_ENABLED=true $(FRESH_BIN) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DeleteSpace method uses the above DeploymentsClient to call the deployments API via the Goa-generated client. Should we do the same here instead of using the ClientGetter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it this way because the new CanGet*() API's are internal, and it seemed more efficient to call directly. However, it's messy in several ways: I had to pass in config.Registry instead of SpaceConfiguration, and it uses the internal CanGetSpace() call, which is ... internal. So I felt slightly dirty coding it.
If I understand it, your proposal is to call //deployments/Space/{spaceID}?qp=true under the hood and use the output of that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, I forgot that in order to get the permissions data we have to get all the space data as well. I don't think this would be a good idea, because of the substantial overhead for data we won't use. Perhaps we should stick with your current approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add a parameter to only get the root space object, but maybe I should just leave that in a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even just skip getting any actual data for the space and only return the permissions. This may be over-complicating one API endpoint though. I'm fine with leaving as a comment for now. I imagine this would need to be addressed when moving deployments out of WIT though.