-
Notifications
You must be signed in to change notification settings - Fork 10
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
Feat: #751 show all workspaces to admin #820
Merged
Merged
Changes from 86 commits
Commits
Show all changes
88 commits
Select commit
Hold shift + click to select a range
3fca942
feat: add GET all-workspaces for admin user
marikaris bb10001
chore: updated vue version
timcadman aad3485
feat: added workspace page
timcadman ca5a903
feat: added workspace tab
timcadman cb607a4
feat: workspace directory now has user email instead of untracable UUID
marikaris e31aec2
chore: remove moved tests
marikaris 76ce1ac
test: add tests
marikaris d7235a5
test(ArmadilloStorageService): add tests for listAllUserWorkspaces
marikaris c795630
refactor(ArmadilloStorageService): split up move workspace function
marikaris 59bd184
refactor: make more suitable for testing
marikaris 7776b49
test(ArmadilloStorageService): add tests
marikaris 2a3daad
refactor: cleanup code
marikaris 308cd65
test(UserInformationRetriever): add tests
marikaris 3e10992
feat: delete workspace for user
marikaris f386c65
chore: remove invalid validation
marikaris f87610e
chore: replace @ in userfoldername with __at__ to make sure we dont r…
marikaris 0c9e30e
chore: change statuscode in delete endpoint and if email address is p…
marikaris a5c8dff
feat: write file with migration status in migrated workspace user bucket
marikaris d9584cd
test(ArmadilloStorageService): add tests for migration status file
marikaris 24ad092
test: fix tests
marikaris 74f5c89
test(DataController): add tests
marikaris 1035d0d
fix: make delete workspace for specified user SU only
marikaris b8ebf58
test: add tests for moveWorkspace method
marikaris 5d45661
Merge branch 'master' into feat/#751-show-all-workspaces-to-admin
marikaris 2f38ea8
feat: added api connection for listing workspaces
timcadman 8a942ec
tried to add type for workspaces
timcadman 33758a1
feat: added function to get workspaces
timcadman 826a5f1
chore: added workspace endpoint to routing
timcadman 1667f7c
feat: view user workspaces
timcadman 65b77e0
fix: correctly detect date as not being an integer
timcadman c7295b1
test: date should not be identified as an integer
timcadman b2fda82
changed return type
timcadman 41fbd63
workspace modified date changed to string
timcadman f183a55
added workspaces tab
timcadman 19f9118
pass workspace data per active user
timcadman 8797761
format workspace data
timcadman a0b01b6
added connection for delete workspaces
timcadman 8d96b13
fix: correctly detect dates in iso format
timcadman 90ecac7
moved to correct file, added type for object of workspaces
timcadman 48bf3f0
corrected type of object returned by workspace api call
timcadman edd5e17
function to delete all workspaces per user
timcadman 80a7ed0
added type for formatted workspaces
timcadman ad33c95
corrected delete workspace api function
timcadman ea4c41f
refactored delete workspace
timcadman 3687fd3
added delete to 8080
timcadman 0f9cedd
chore(ui): show icon for workspace tab
marikaris 15d0574
chore: add checkboxes to delete workspaces and fix confirmation dialog
marikaris 49afc58
chore: cleanup things
marikaris 5f8918e
collect errors and display them
timcadman d9ac63f
try: add 'all workspaces' summary
timcadman c09e2e7
Merge branch 'master' into feat/#751-show-all-workspaces-to-admin
marikaris 7470391
refactor: refactored all workspaces function
timcadman 3306a58
sort users alphabetically
timcadman 74702d0
updated workspace type to include user
timcadman 49f4544
Display all users and only show used column
timcadman 34af9c9
fix: don't select two workspaces when checking in the all-workspaces …
timcadman 735bb78
chore: make table of workspaces sortable
marikaris c818323
fix booboo when isAscending is undefined should pretend like its true
marikaris 63de548
only return workspaces and migration-status file in all-workspaces en…
marikaris c9d11c9
sort workspaces on workspace name
marikaris 5cb17e2
cleanup UI for workspaces
marikaris 6cbdc45
feat: get migration status endpoint
marikaris 006f908
fix code smells
marikaris a26ecd9
fix typing
marikaris 903d498
change regex to hopefully appease sonar
marikaris 8f9acca
refactor: rewrite regex part
marikaris 665d3b6
fix filename
marikaris b998ad4
hopefully appease sonar with regex
marikaris dbe0170
test: fix testdata
marikaris 0e9638d
test: increase coverage
marikaris c3b99ec
make regex less greedy
marikaris f5e4584
refactor: get rid of impossible regex
marikaris 37fe0c4
feat: endpoint for copying file from one workspace folder to another
marikaris f74a3df
refactor: prefix migration file endpoint with 'workspaces'
marikaris e82db3b
refactor: rename directories in API output of migration file endpoint…
marikaris 443d43c
feat: show migration file information and copy when unsuccesful
marikaris e187794
feat: add endpoint for deleting entire user workspace directory
marikaris e2d03be
feat: make delete workspace button when migration succesful functional
marikaris 04ac4dd
refactor: instead of copy move workspaces and remove all endpoints to…
marikaris f4f4220
test: add test for delete workspace directory endpoint
marikaris 42a1749
feat: delete user workspace directory
marikaris d6aa547
Merge branch 'master' into feat/#751-show-all-workspaces-to-admin
marikaris b7be024
chore: fix typing
marikaris a7fdd82
test: add first test for workspaces
marikaris 4e3abce
return 404 when object doensnt exist when deleting
marikaris f162b00
Merge branch 'master' into feat/#751-show-all-workspaces-to-admin
marikaris 0efa460
refactor: rename static method to minimise code changes
marikaris f5cd54a
Merge branch 'master' into feat/#751-show-all-workspaces-to-admin
marikaris 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
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
33 changes: 33 additions & 0 deletions
33
armadillo/src/main/java/org/molgenis/armadillo/info/UserInformationRetriever.java
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,33 @@ | ||
package org.molgenis.armadillo.info; | ||
|
||
import java.security.Principal; | ||
import org.springframework.security.core.userdetails.User; | ||
import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; | ||
import org.springframework.security.oauth2.core.user.DefaultOAuth2User; | ||
import org.springframework.security.oauth2.jwt.Jwt; | ||
import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken; | ||
|
||
public class UserInformationRetriever { | ||
static final String EMAIL = "email"; | ||
static final String ANONYMOUS = "ANONYMOUS"; | ||
|
||
public static String getUserIdentifierFromPrincipal(Object principal) { | ||
if (principal == null) { | ||
return ANONYMOUS; | ||
} else if (principal instanceof OAuth2AuthenticationToken token) { | ||
return token.getPrincipal().getAttribute(EMAIL); | ||
} else if (principal instanceof JwtAuthenticationToken token) { | ||
return token.getTokenAttributes().get(EMAIL).toString(); | ||
} else if (principal instanceof DefaultOAuth2User user) { | ||
return user.getAttributes().get(EMAIL).toString(); | ||
} else if (principal instanceof Jwt jwt) { | ||
return jwt.getClaims().get(EMAIL).toString(); | ||
} else if (principal instanceof User user) { | ||
return user.getUsername(); | ||
} else if (principal instanceof Principal p) { | ||
return p.getName(); | ||
} else { | ||
return principal.toString(); | ||
} | ||
} | ||
} |
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.
waarom heb je deze nieuwe functie niet ook gewoon getUser genoemd? Dat had flink wat code changes verborgen ;-)
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.
Goede vraag. Ga ik aanpassen haha