Skip to content

Commit

Permalink
spreadsheets-google: clean up secret management
Browse files Browse the repository at this point in the history
  • Loading branch information
clezag committed Oct 17, 2023
1 parent fff8624 commit bb1cf2f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion data-collectors/spreadsheets-google/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ clientId=odh-mobility-datacollector
VENDOR=staEcharging
BASE_URI=https://mobility.share.opendatahub.testingmachine.eu/json
LOG_LEVEL=debug
LOG_STYLE=json
LOG_STYLE=json

google.auth.client_secret_location=file:/credentials/client_secret.json
google.auth.credentials_folder=file:/credentials
3 changes: 2 additions & 1 deletion data-collectors/spreadsheets-google/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ services:
- 9000:9000
- 9001:9001
volumes:
- ~/.m2/:/var/maven/.m2:Z
- ~/.m2/:/var/maven/.m2
- ./:/code
- ./credentials:/credentials
working_dir: /code
tty: true
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@
remote: docker-compose.yml
- local: ../../.env
remote: .env
- local: ../../credentials
remote: credentials
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ services:
- .env
ports:
- ${SERVER_PORT}:8080
volumes:
- ./credentials:/credentials
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
@Service
public abstract class GoogleAuthenticator {

@Value("classpath:/META-INF/spring/client_secret.json")
@Value("${google.auth.client_secret_location}")
private Resource clientSecret;
private NetHttpTransport HTTP_TRANSPORT;
private JsonFactory JSON_FACTORY = GsonFactory.getDefaultInstance();
@Value("classpath:META-INF/credentials")
@Value("${google.auth.credentials_folder}")
private Resource credentialsFolder;

protected Credential getCredentials() throws IOException {
Expand Down

This file was deleted.

0 comments on commit bb1cf2f

Please sign in to comment.