Hello Admin app provides a UI for Account creation and access token generation.
Internal Tools for Hello Team
dev, i.e https://dev-dot-hello-admin.appspot.com/ which points to dev databaseRequires a @sayhello.com email address.
hello-admin is authorized through our Google Apps Account. If you want deploy changes, you need to be added to the list of administrators for the app. Let me (tim@sayhello.com) know and I’ll add you.
Populate Credentials for Local: Goto http://localhost:8080/setup
Populate Credentials for Prod:
0. Generate a gae admin account like gae@sayhello.com by calling @POST /v1/account. See Registration class.
0. Generate an OAuth application by calling @POST /v1/applications with
post_data = {
"name": "GAE Admin app",
"client_id": "gae_admin",
"client_secret": "gae secret",
"redirect_uri": "https://hello-admin.appspot.com",
"scopes": ["AUTH", "ADMINISTRATION_READ", "ADMINISTRATION_WRITE"],
"description": "admin oauth app"
}.
You need a token with scope ADMINISTRATION_WRITE but will realize tokens can only be created by calling @POST /v1/oauth2/token with a post data specifying client_id of the application which you don’t currently have. Ask Tim to do deploy a soft API allowing you to get_or_create a token with any client_id, i.e. if the posted client_id doesn’t belong to any known applications, that api will create a new application and return the token associated with it. In this case, we want a gae_admin token for gae@sayhello.com
__init__(self, request, response) of class ProtectedRequestHandler if settings.DEBUG is False:
self.restrict()
Deploy the change to a version, let’s say setup (Set version: setup at app.yaml before deploying)
Follow instruction at https://setup-dot-hello-admin.appspot.com/setup
If you can’t get to https://setup-dot-hello-admin.appspot.com/setup, do:
Create AppInfo, AppUser, ZendeskCredentials, SearchifyCredentials by visiting https://setup-dot-hello-admin.appspot.com/api/setup
If needed, recreate user-group entity by visiting https://setup-dot-hello-admin.appspot.com/api/create_groups
If needed, recreate key store locker by visiting https://setup-dot-hello-admin.appspot.com/api/create_key_store_locker
Above actions wipe out current entities and init defaults.
- You want to update them at https://appengine.google.com/datastore/explorer?&app_id=s~hello-admin.
- For admin_user: you want to use the created gae@sayhello.com account in step i
- For app_info: you want to use the created gae_admin application created in step ii
- For RSA keys, you want to use https://setup-dot-hello-admin.appspot.com/provision because GAE doesn’t allow text changes on prod
Flush memcache
Finally, visit https://setup-dot-hello-admin.appspot.com/update
Remember not to check the changes in step iii in master because we want restriction on all other versions. It maybe a good idea to keep a setup version around just in case.
AccessToken entities in datastore need to be purged: All the expired tokens there need to be removed, otherwise we may keep calling java server using dead tokens (esp. after a migration).
Update Current Credentials
postData = {deploy-admin.sh with content like scripts/deploy.shsuripu-admin.conf with the content like scripts/suripu-admin.confdeploy-admin.sh to get the latest suripu-admin jar & yml, update & restart suripu-admin