-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3840 from uselagoon/manage-platform-users
feat: view, add, and remove platform roles on users
- Loading branch information
Showing
14 changed files
with
572 additions
and
40 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -674,6 +674,48 @@ mutation PopulateApi { | |
id | ||
} | ||
|
||
UserExamplePlatformOrgOwner: addUser( | ||
input: { | ||
email: "[email protected]" | ||
comment: "platform organization owner user" | ||
} | ||
) { | ||
id | ||
} | ||
|
||
## Assign platform owner role | ||
UserExamplePlatformOwnerRole: addPlatformRoleToUser( | ||
user:{ | ||
email:"[email protected]" | ||
} | ||
role: OWNER | ||
){ | ||
platformRoles | ||
} | ||
|
||
## Assign platform viewer role | ||
UserExamplePlatformViewerRole: addPlatformRoleToUser( | ||
user:{ | ||
email:"[email protected]" | ||
} | ||
role: VIEWER | ||
){ | ||
platformRoles | ||
} | ||
|
||
## Assign platform owner role | ||
UserExamplePlatformOrgOwnerRole: addPlatformRoleToUser( | ||
user:{ | ||
email:"[email protected]" | ||
} | ||
role: ORGANIZATION_OWNER | ||
){ | ||
platformRoles | ||
} | ||
|
||
LagoonDemoGroup: addGroup( | ||
input: { | ||
name: "lagoon-demo-group" | ||
|
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 |
---|---|---|
|
@@ -79,6 +79,48 @@ mutation PopulateApi { | |
id | ||
} | ||
|
||
UserExamplePlatformOrgOwner: addUser( | ||
input: { | ||
email: "[email protected]" | ||
comment: "platform organization owner user" | ||
} | ||
) { | ||
id | ||
} | ||
|
||
## Assign platform owner role | ||
UserExamplePlatformOwnerRole: addPlatformRoleToUser( | ||
user:{ | ||
email:"[email protected]" | ||
} | ||
role: OWNER | ||
){ | ||
platformRoles | ||
} | ||
|
||
## Assign platform viewer role | ||
UserExamplePlatformViewerRole: addPlatformRoleToUser( | ||
user:{ | ||
email:"[email protected]" | ||
} | ||
role: VIEWER | ||
){ | ||
platformRoles | ||
} | ||
|
||
## Assign platform organization owner role | ||
UserExamplePlatformOrgOwnerRole: addPlatformRoleToUser( | ||
user:{ | ||
email:"[email protected]" | ||
} | ||
role: ORGANIZATION_OWNER | ||
){ | ||
platformRoles | ||
} | ||
|
||
LagoonDemoGroup: addGroup( | ||
input: { | ||
name: "lagoon-demo-group" | ||
|
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 |
---|---|---|
|
@@ -10,7 +10,8 @@ function is_keycloak_running { | |
function configure_user_passwords { | ||
|
||
LAGOON_DEMO_USERS=("[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]") | ||
LAGOON_DEMO_ORG_USERS=("[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]") | ||
LAGOON_DEMO_ORG_USERS=("[email protected]" "[email protected]" "[email protected]" "[email protected]") | ||
LAGOON_DEMO_PLATFORM_USERS=("[email protected]" "[email protected]" "[email protected]") | ||
|
||
for i in ${LAGOON_DEMO_USERS[@]} | ||
do | ||
|
@@ -23,16 +24,12 @@ function configure_user_passwords { | |
echo Configuring password for $i | ||
/opt/keycloak/bin/kcadm.sh set-password --config $CONFIG_PATH --username $i -p $i --target-realm lagoon | ||
done | ||
} | ||
|
||
function configure_platformowner { | ||
echo Configuring platform owner role | ||
/opt/keycloak/bin/kcadm.sh add-roles --uusername [email protected] --rolename platform-owner --config $CONFIG_PATH --target-realm lagoon | ||
} | ||
|
||
function configure_platformviewer { | ||
echo Configuring platform viewer role | ||
/opt/keycloak/bin/kcadm.sh add-roles --uusername [email protected] --rolename platform-viewer --config $CONFIG_PATH --target-realm lagoon | ||
for i in ${LAGOON_DEMO_PLATFORM_USERS[@]} | ||
do | ||
echo Configuring password for $i | ||
/opt/keycloak/bin/kcadm.sh set-password --config $CONFIG_PATH --username $i -p $i --target-realm lagoon | ||
done | ||
} | ||
|
||
function configure_keycloak { | ||
|
@@ -49,8 +46,6 @@ function configure_keycloak { | |
/opt/keycloak/bin/kcadm.sh config credentials --config $CONFIG_PATH --server http://localhost:8080/auth --user $KEYCLOAK_ADMIN_USER --password $KEYCLOAK_ADMIN_PASSWORD --realm master | ||
|
||
configure_user_passwords | ||
configure_platformowner | ||
configure_platformviewer | ||
|
||
echo "Config of Keycloak users done" | ||
} | ||
|
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.