The STEP intern project for Google's AC Admin SRE team.
Welcome to GRoot - Admin Console Visualizer!
GRoot helps you to better visualize the structure and relationships for organizational units, groups, and users. You could also perform admin operations, such as adding, deleting, editing, smoothly with our interative interface.
Because G Suite Admin SDK contains sensitive user data, to prevent potential privacy issues, we recommend you to clone our repository and make your own instance of GCP App Engine.
- Open up your terminal, we recommand Google Cloud Shell if you have a Google account, you can log in with your admin account.
$cd
to change directory to your target path, then clone the repo:$ git clone https://github.com/googleinterns/step45-2020.git
$ cd step45-2020
$ sudo apt install ./google-chrome-beta_current_amd64.deb
- run
$ mvn package appengine:run -DskipTests=true
- After seeing
Dev app Server is now running
, click the rectangle button left to three dots in top right ->Preview on port 8080
, the project is not set up yet, but you need to copy your server url, i.e. https://8080-5686c74b-aced-4f8e-83f7-f129248a983f.us-east1.cloudshell.dev ctrl + c
to interrupt the running project.
In the cloud console (https://console.cloud.google.com/), first login to your test account, then select create your own project groot
. Then, APIs & Services -> OAuth consent screen
APIs & Services -> Dashboard -> ENABLE APIS AND SERVICES -> Search for Admin SDK
-> ENABLE
- APIs & Services -> OAuth consent screen
- Select
User Type
to be Internal, then clickCreate
. - Click
Add scope
, then enter the following scopes:https://www.googleapis.com/auth/admin.directory.orgunit
,https://www.googleapis.com/auth/admin.directory.group
,https://www.googleapis.com/auth/admin.directory.user
- Under
Authorized domains
, addcloudshell.dev
Save
the changes
- APIs & Services -> Credentials -> Create Credentials -> OAuth Client ID -> Web client 1
- Click the edit button
- Under Authorized JavaScript origins -> URIs and Authorized redirect URIs -> URIs, add your server url, i.e. https://8080-5686c74b-aced-4f8e-83f7-f129248a983f.us-east1.cloudshell.dev
- run
$ mvn package appengine:run -DskipTests=true
or$ mvn package appengine:run
(the later command will run test cases)- This runs your localhost:8080 cloudshell server
- Copy the URL from the browser search bar, i.e. https://8080-5686c74b-aced-4f8e-83f7-f129248a983f.us-east1.cloudshell.dev
400 mismatch error
- Remember to have the exact URI in your code as the one in console.developers.google.com !! I had an extra slash at the end of my URI
403 error
- Remember to login with your test account
- Do not use incognito window
- If your google corp account is logged in automatically, open up the web console, then type “localStorage.clear();”
404 error
- Remember to follow step #4 in the instructions above
You can execute tests by running mvn test
which will execute the javascript tests located under src/test/javascript
Mavin will download most of the requirments including the Chrome Webdriver, but Chrome will need to be installed. By default it uses the latest beta version.
For Cloud Shell, run the following commands at the start of your session to install Chrome beta
$ wget https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb
$ sudo apt install ./google-chrome-beta_current_amd64.deb
$ mvn test
Alternatively, you can create a .customize_environment file based on the sample file provided under samples/ Cloud Shell will execute this script every time Cloud Shell starts.
View manual tests here: