Skip to content

Commit 0c8f393

Browse files
authored
Merge pull request #379 from dhaval055/master
added GWS app
2 parents f0ff580 + 4b68226 commit 0c8f393

File tree

5 files changed

+308
-0
lines changed

5 files changed

+308
-0
lines changed

gws/1.0.0/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Base our app image off of the WALKOFF App SDK image
2+
FROM frikky/shuffle:app_sdk as base
3+
4+
# We're going to stage away all of the bloat from the build tools so lets create a builder stage
5+
FROM base as builder
6+
7+
# Install all alpine build tools needed for our pip installs
8+
RUN apk --no-cache add --update alpine-sdk libffi libffi-dev musl-dev openssl-dev
9+
10+
# Install all of our pip packages in a single directory that we can copy to our base image later
11+
RUN mkdir /install
12+
WORKDIR /install
13+
COPY requirements.txt /requirements.txt
14+
RUN pip install --prefix="/install" -r /requirements.txt
15+
16+
# Switch back to our base image and copy in all of our built packages and source code
17+
FROM base
18+
COPY --from=builder /install /usr/local
19+
COPY src /app
20+
21+
# Install any binary dependencies needed in our final image
22+
# RUN apk --no-cache add --update my_binary_dependency
23+
24+
# Finally, lets run our app!
25+
WORKDIR /app
26+
CMD python app.py --log-level DEBUG

gws/1.0.0/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## Google Workspace
2+
An app for interacting with Google Workspace or GWS.
3+
## Requirements
4+
1) Enable the Admin SDK API from GCP console.
5+
- Login to Google cloud (Make sure you are using the same administrator acount that you're using for Google Workspace) and In the navigation menu on the left-hand side, click on “APIs & Services” > “Library”.
6+
- In the API Library, use the search bar to find the "Admin SDK". Click on it to open the API page.
7+
- Click the “Enable” button to activate the Admin SDK API for your project.
8+
2) Create a Service account.
9+
- Go to the navigation menu, and select “IAM & Admin” > “Service Accounts”.
10+
- Click on “Create Service Account” at the top of the page.
11+
- Enter a service account name and description, then click “Create”.
12+
- You can skip the permission part here as we will be adding persmissions from GWS console later on.
13+
- In the service account details page, click on “Keys”.
14+
- Click on “Add Key” and select “Create new key”.
15+
- Choose “JSON” as the key type and click “Create”. This will download the JSON key file which contains the “client_id”. Note down this client ID.
16+
17+
3) Subject (Email address associated with the service account)
18+
- Note down the email address associated with the service account you just created it'll be used in the authentication in Shuffle.
19+
4) Adding permissions to the service account from GWS console.
20+
- Signin to the Google Workspace admin console.
21+
- In the Admin console, locate the sidebar and navigate to Security > API controls. This area allows you to manage third-party and internal application access to your Google Workspace data.
22+
- Under the Domain-wide delegation section, click on “Manage Domain Wide Delegation” to view and configure client access.
23+
- If the service account client ID is not listed, you will add it; if it is already listed but you need to update permissions, click on the service account’s client ID. To add a new client ID:
24+
- Click on Add new.
25+
- Enter the Client ID of the service account you noted earlier when creating the service account in GCP.
26+
- In the OAuth Scopes field, enter the scopes required for your service account to function correctly. OAuth Scopes specify the permissions that your application requests.
27+
- Depending on the actions you want to use below are the OAuth scopes required.
28+
29+
| Action | OAuth Scope |
30+
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
31+
| Reset User Password | `https://www.googleapis.com/auth/admin.directory.user` |
32+
| Suspend User | `https://www.googleapis.com/auth/admin.directory.user` |
33+
| Get User Devices |`https://www.googleapis.com/auth/admin.directory.device.mobile` |
34+
| Reactivate User | `https://www.googleapis.com/auth/admin.directory.user`
35+
36+
## Authentication
37+
1) Upload the Service account JSON file in to the Shuffle files and copy the file id.
38+
2) Now, Inside the GWS app authentication in Shuffle; use the file id you just copied and in subject use the email address asscoitate with your service account.
39+
40+

0 commit comments

Comments
 (0)