Skip to content

feat: introduce google client#219

Merged
dzehnder merged 27 commits intomainfrom
google-client
May 21, 2024
Merged

feat: introduce google client#219
dzehnder merged 27 commits intomainfrom
google-client

Conversation

@dzehnder
Copy link
Contributor

@dzehnder dzehnder commented Apr 22, 2024

This PR introduces the GoogleClient, designed to facilitate interactions with Google APIs for retrieving organic search data and listing sites. The class uses AWS Secrets Manager to securely manage Google OAuth credentials, ensuring secure and efficient API requests.

@github-actions
Copy link

This PR will trigger a minor release when merged.

@dzehnder dzehnder changed the title feat: introduce google client authentication configuration feat: introduce google client Apr 30, 2024
@dzehnder
Copy link
Contributor Author

dzehnder commented Apr 30, 2024

@dzehnder dzehnder marked this pull request as ready for review April 30, 2024 15:23
@dzehnder dzehnder requested review from ekremney and solaris007 April 30, 2024 15:23
this.log = log;
}

async getOrganicSearchData(baseURL, startDate, endDate) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could add startRow and rowLimit as params with default values 0 and 10. That way, this API could also provide a way to paginate

);

authClient.setCredentials({
access_token: context.env.ACCESS_TOKEN,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are access token and refresh token expected to come from env variables? 🤔 these should be short lived creds, unless we don't have a way to automatically rotate them, I guess we need to obtain these tokens freshly from google, not from env variables

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea was to write a customer secret wrapper, that adds the secrets as env variables for the duration of the function execution.
Do you think this should be handled differently?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea was to write a customer secret wrapper, that adds the secrets as env variables for the duration of the function execution.

where the "customer secret wrapper" is expected to read those secrets from? request body or the query params? If that's the case, then we can get it from context.data or context.params

@dzehnder dzehnder requested review from alinarublea and iuliag May 16, 2024 15:30
@dzehnder dzehnder added the enhancement New feature or request label May 17, 2024
@dzehnder dzehnder self-assigned this May 17, 2024
@dzehnder dzehnder requested a review from ekremney May 17, 2024 13:17
@solaris007
Copy link
Member

some improvements discussed f2f (checkauth method and input validation, version pinning)

Copy link
Member

@solaris007 solaris007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dzehnder dzehnder merged commit 71eeb64 into main May 21, 2024
@dzehnder dzehnder deleted the google-client branch May 21, 2024 11:45
adobe-bot pushed a commit that referenced this pull request May 21, 2024
# @adobe/spacecat-shared-google-client-v1.0.0 (2024-05-21)

### Features

* introduce google client ([#219](#219)) ([71eeb64](71eeb64))
@adobe-bot
Copy link

🎉 This PR is included in version @adobe/spacecat-shared-google-client-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

adobe-bot pushed a commit that referenced this pull request May 21, 2024
@adobe-bot
Copy link

🎉 This PR is included in version @adobe/spacecat-shared-http-utils-v1.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants