Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): add @coveo/search-token-server package #33

Merged
merged 13 commits into from
Feb 17, 2021
Merged

feat(cli): add @coveo/search-token-server package #33

merged 13 commits into from
Feb 17, 2021

Conversation

y-lakhdar
Copy link
Contributor

@github-actions
Copy link
Contributor

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

packages/search-token-server/utils/cloudPlatformAPI.ts Outdated Show resolved Hide resolved
packages/search-token-server/middlewares/searchToken.ts Outdated Show resolved Hide resolved
packages/search-token-server/tsconfig.json Show resolved Hide resolved
@@ -0,0 +1,8 @@
# Coveo related configuration
COVEO_PLATFORM_HOSTNAME=<PLATFORM_HOSTNAME dev,qa,prod,hippa>
# for example https://platform.cloud.coveo.com
Copy link
Member

@olamothe olamothe Feb 16, 2021

Choose a reason for hiding this comment

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

Maybe just me, but I would put the comment above the line it explains ;)

And a comment that says to look at README.

In general, don't be afraid to put quite a bit of explanation about what everything is with a lot of detail.

Think from the point of view from a total newbie that just started to play with Coveo interacting through the CLI.

They need explanation about what are the valid platform endpoint, what is an API key/where to see them in your organization, the privileges required, what is a search hub etc..

All of these are well explained in our documentation, so try to always link to an article that would help a total newbie to roughly understand what's going on.

Without that, it is all very cryptic. This module/package can be seen as a good way to teach.

packages/search-token-server/README.md Outdated Show resolved Hide resolved
packages/search-token-server/middlewares/searchToken.ts Outdated Show resolved Hide resolved
packages/search-token-server/.env.example Outdated Show resolved Hide resolved
COVEO_PLATFORM_HOSTNAME=<PLATFORM_HOSTNAME dev,qa,prod,hippa>
# for example https://platform.cloud.coveo.com
COVEO_API_KEY=<YOUR_COVEO_API_KEY_HERE>
USER_EMAIL=<YOUR_EMAIL>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion:
The name of the security identity to impersonate.
Example: "[email protected]"
See https://docs.coveo.com/en/56/#name-string-required.

(If I understand correctly)

packages/search-token-server/.env.example Outdated Show resolved Hide resolved
packages/search-token-server/.env.example Outdated Show resolved Hide resolved
packages/search-token-server/.env.example Outdated Show resolved Hide resolved
packages/search-token-server/README.md Outdated Show resolved Hide resolved
packages/search-token-server/.env.example Outdated Show resolved Hide resolved
Copy link
Collaborator

@louis-bompart louis-bompart left a comment

Choose a reason for hiding this comment

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

LGTM overall!

packages/search-token-server/.gitignore Outdated Show resolved Hide resolved
provider: 'Email Security Provider',
}));

getSearchToken({
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would use an async await to 'flatten' the code personnaly

packages/search-token-server/.env.example Outdated Show resolved Hide resolved
packages/search-token-server/.env.example Outdated Show resolved Hide resolved
packages/search-token-server/README.md Outdated Show resolved Hide resolved
packages/search-token-server/README.md Outdated Show resolved Hide resolved
packages/search-token-server/README.md Outdated Show resolved Hide resolved
packages/search-token-server/middlewares/searchToken.ts Outdated Show resolved Hide resolved
packages/search-token-server/middlewares/searchToken.ts Outdated Show resolved Hide resolved
*/
userIds: [
{
// The security identities to impersonate when authenticating a query with this search token.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this line document the following three lines or just the name? If it's just the name I'd go with:
// The name of the security identity to impersonate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oups. This line should be removed. It's a duplicate of the above line.

packages/search-token-server/middlewares/searchToken.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@jpmarceau jpmarceau left a comment

Choose a reason for hiding this comment

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

Looks great, GG!

@y-lakhdar y-lakhdar merged commit 23c9035 into master Feb 17, 2021
@louis-bompart louis-bompart deleted the CDX-85 branch June 7, 2021 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants