Skip to content
This repository has been archived by the owner on May 18, 2023. It is now read-only.

Subscribe with Google integration - A service that receives push notifications for every subscription event

Notifications You must be signed in to change notification settings

guardian/subscribe-with-google

Repository files navigation

Subscribe with Google

This application allows us to receive contribution and subscription events from Google.

How to run

sbt run

This will start the Play server in devmode.

You can then check the application is running by hitting

Local: http://localhost:9233/healthcheck

Prod: https://swg.theguardian.com/healthcheck

The application has a POST endpoint that receives JSON from the Google Cloud PubSub queue.

This can be tested by running the spoofer with an instance of ElasticMQ.

http://localhost:5000/ has a console that you can submit messages to the queue and you can see them ingested in the app.


Style, coverage, warnings

This application ships with sbt plugins: scalastyle, scapegoat, scoverage.

We aim to be warning free, warts free and sustain a high level of branch coverage. Although we don't strive to have a high test coverage, we use the reports to identify areas of untested code.

Reports can be generated by running the command

sbt scalastyle scapegoat coverge test coverageReport

Coverage report location: <repo-home>/target/scala-2.12/scoverage-report/index.html

Scapegoat report location: <repo-home>/target/scala-2.12/scapegoat-report/scapegoat.html

Scalastyle report location: <repo-home>/target/scalastyle-result.xml

Refresh token for talking with Google APIs

A long living refresh token is stored in AWS Param Store under /$app/$stage/google/playDeveloperRefreshToken. This token can be re-generated with the following steps.

This token is used by the application to generate shorter living access tokens used to talk with Google APIs. GoogleAccessTokenClient caches these access tokens with the expiry time returned by the API.

About

Subscribe with Google integration - A service that receives push notifications for every subscription event

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •