-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Userendpoints #4875
Closed
Closed
Userendpoints #4875
Conversation
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
Signed-off-by: Thomas Quandt <[email protected]>
…cloudfoundry#4753) Needs to be properly implemented later. Signed-off-by: Thomas Quandt <[email protected]>
Adjust files to insert the userID to an endpoint when it's created. Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
* Add a query to get all uaa tokens * Add a query to get all cnsis from the user who created it * Filter endpoints for endpointadmins - All admin endpoints and user-specific endpoints will be returned Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
) Signed-off-by: Thomas Quandt <[email protected]>
…y#4753) * Split ENDPOINT_REGISTER into two separate permissions to check for admin or endpointadmin * Add CreatorInfo to structs and EndpointDetail Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
…oundry#4753) Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
…loudfoundry#4753) * Add env var enableUserEndpoints to store model * Adjust components for enableUserEndpoints * Small adjustments in the back-end to enableUserEndpoints * Consider an empty string for the creator as an admin user Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
* User endpoints with same APIEndpoint will be automatically removed when admin creates endpoint * Split list functions in pgsql_cnsi into a generic function Signed-off-by: Thomas Quandt <[email protected]>
…undry#4753) Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
* Let admins see all endpoints again * Add checkbox to overwrite user-endpoints when admins create a checkpoint * Add OverwriteEndpoints to the HTTP Request * Fix existingEndpoints in git-registration component (was always null) * Change subscription to observable in endpoints page component Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
…4753) Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
* Change AutoRegisterEndpoint to always create as an anonymous admin * Adjust GetCNSIRecordByEndpoint to search for admin created endpoints only * Revert change in cnsiRecordExists to now check the url again instead guid Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
* Change EnableUserEndpoints to UserEndpointsEnabled and make it enum * If admins see user endpoints depend now on enum * Users only see their own endpoints if flag explicitly set to enabled Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
Update test branch with current changes.
* Adjust mock data * Add basic db functions to desktop plugins * Check user in cnsi login only if userendpoints enabled * Check user in cnsi register only if userendpoints enabled Signed-off-by: Thomas Quandt <[email protected]>
* Only user-endpoints save an id in creator column * If user cant be found, set it as anonymous user Signed-off-by: Thomas Quandt <[email protected]>
|
Signed-off-by: Thomas Quandt <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #4875 +/- ##
===========================================
- Coverage 52.91% 26.35% -26.57%
===========================================
Files 1141 61 -1080
Lines 40149 4925 -35224
Branches 5122 0 -5122
===========================================
- Hits 21246 1298 -19948
+ Misses 18719 3430 -15289
- Partials 184 197 +13 |
Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
* Add missing providers to frontend unit tests * Fix two errors outside of tests Signed-off-by: Thomas Quandt <[email protected]>
Signed-off-by: Thomas Quandt <[email protected]>
Closing in favour of #4876 (avoids travis issues) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The feature lets users create endpoints if they have the "stratos.endpointadmin" scope.
Description
General Behaviour
Back-End
endpointMiddleware()
buildCNSIList()
registerEndpoints()
DoRegisterEndpoints()
unregisterCluster()
unregisterCluster(c echo.Context)
anddoUnregisterCluster(cnsiGUID string)
, so that cnsi can be unregistered without the need of anecho.Context
ListAdminEndpoints(userID string)
listCNSIByAPIEndpoint(apiEndpoint string)
GetCNSIRecordByEndpoint()
andcnsiRecordExists()
toGetAdminCNSIRecordByEndpoint()
andadminCNSIRecordExists()
to better reflect their function nowDoLoginToCNSI()
getInfo()
creator
from cnsi and replaces it with interface.CreatorInfoENABLE_USER_ENDPOINTS
todisabled
as defaultcheckEndpointCreator()
Creator
to several structsUserEndpointsEnabled
toPortalConfig
andInfo
OverwriteEndpoints
toRegisterEndpointParams
listCNSIsByCreator
sql query and belonging functionsfindCNSIByAPIEndpoint
listBy()
function because DRYlistAuthToken
sql query and belonging functionsFront-End
CreatorInfo
interface to hold creator user data for cnsistratos.endpointadmin
as a scope that can be checked forUSER_ENDPOINTS_ENABLED
enableUserEndpoints
tointerface SessionDataConfig
Motivation and Context
Issue #4753
How Has This Been Tested?
OS: macOS Big Sur
go test
passesnpm run test-backend
fails without changes in #4874e2e tests fail on local machine with following setup:
So far only adjusted mock data to mostly accommodate the new added column to the cnsi table, to check that everything behaves the same when the feature is disabled.
I will add more test functions later, as discussed with @richard-cox . This PR is for looking over the code while i continue to adjust the tests.
Types of changes
Checklist: