Skip to content
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

added GWS app #379

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions gws/1.0.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Base our app image off of the WALKOFF App SDK image
FROM frikky/shuffle:app_sdk as base

# We're going to stage away all of the bloat from the build tools so lets create a builder stage
FROM base as builder

# Install all alpine build tools needed for our pip installs
RUN apk --no-cache add --update alpine-sdk libffi libffi-dev musl-dev openssl-dev

# Install all of our pip packages in a single directory that we can copy to our base image later
RUN mkdir /install
WORKDIR /install
COPY requirements.txt /requirements.txt
RUN pip install --prefix="/install" -r /requirements.txt

# Switch back to our base image and copy in all of our built packages and source code
FROM base
COPY --from=builder /install /usr/local
COPY src /app

# Install any binary dependencies needed in our final image
# RUN apk --no-cache add --update my_binary_dependency

# Finally, lets run our app!
WORKDIR /app
CMD python app.py --log-level DEBUG
40 changes: 40 additions & 0 deletions gws/1.0.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## Google Workspace
An app for interacting with Google Workspace or GWS.
## Requirements
1) Enable the Admin SDK API from GCP console.
- 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”.
- In the API Library, use the search bar to find the "Admin SDK". Click on it to open the API page.
- Click the “Enable” button to activate the Admin SDK API for your project.
2) Create a Service account.
- Go to the navigation menu, and select “IAM & Admin” > “Service Accounts”.
- Click on “Create Service Account” at the top of the page.
- Enter a service account name and description, then click “Create”.
- You can skip the permission part here as we will be adding persmissions from GWS console later on.
- In the service account details page, click on “Keys”.
- Click on “Add Key” and select “Create new key”.
- 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.

3) Subject (Email address associated with the service account)
- Note down the email address associated with the service account you just created it'll be used in the authentication in Shuffle.
4) Adding permissions to the service account from GWS console.
- Signin to the Google Workspace admin console.
- 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.
- Under the Domain-wide delegation section, click on “Manage Domain Wide Delegation” to view and configure client access.
- 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:
- Click on Add new.
- Enter the Client ID of the service account you noted earlier when creating the service account in GCP.
- 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.
- Depending on the actions you want to use below are the OAuth scopes required.

| Action | OAuth Scope |
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| Reset User Password | `https://www.googleapis.com/auth/admin.directory.user` |
| Suspend User | `https://www.googleapis.com/auth/admin.directory.user` |
| Get User Devices |`https://www.googleapis.com/auth/admin.directory.device.mobile` |
| Reactivate User | `https://www.googleapis.com/auth/admin.directory.user`

## Authentication
1) Upload the Service account JSON file in to the Shuffle files and copy the file id.
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.


Loading
Loading