Prepare:
- set up ADC
- download a service account key (or provide one on drive? for folks to share in testing)
Tests on credentials
- run
SpringAutoconfTestApplication.java
. - in a terminal, call
curl http://localhost:8080/language
and observe output. shows similar to:
c.e.s.SpringAutoconfTestApplication : Default credentials provider for user xxxxxx.apps.googleusercontent.com
c.e.s.SpringAutoconfTestApplication : user credential ProjectId: [your-default-application-credentials-project-id]
- uncomment/set
spring.cloud.gcp.credentials.location
inapplication.properties
- call
curl http://localhost:8080/language
again, this time log should print out the service account in use:c.e.s.SpringAutoconfTestApplication : Default credentials provider for service account [email protected]
- test for a combination of global/service level credentials
Test on quotaProjectId
- set
com.google.cloud.language.v1.language-service.quotaProjectId
inapplication.properties
- run application
- call
curl http://localhost:8080/functions
log prints: quotaProjectId set for Client library: null
- call
curl http://localhost:8080/language
log prints: quotaProjectId set for Client library: [quota project id set in application.properties]