Skip to content

Commit

Permalink
feat(cli): support apikey for ui:deploy (#1455)
Browse files Browse the repository at this point in the history
<!-- For Coveo Employees only. Fill this section.

CDX-1449
-->

## Proposed changes

- Allow users to authenticate using API key to deploy their pages.

## Testing

- [x] Unit Tests: existing tests was testing for failure.
<!-- Did you write unit tests for your feature? If not, explains why?
-->
- [ ] Functionnal Tests:
<!-- Did you write functionnal tests for your feature? If not, explains
why? -->
- [x] Manual Tests: `@coveo/[email protected]` was tested in both a
local terminal and a CI by @jfallaire.
  • Loading branch information
louis-bompart authored Apr 2, 2024
1 parent 36e724d commit d296470
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 0 additions & 12 deletions packages/cli/core/src/commands/ui/deploy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,6 @@ describe('ui:deploy', () => {
});

describe('when preconditions are not respected', () => {
test
.do(() => {
preconditionStatus.apiKey = false;
})
.stdout()
.stderr()
.command(['ui:deploy'])
.catch(/apiKey Precondition Error/)
.it(
'should not execute the command if the API key preconditions are not respected'
);

test
.do(() => {
preconditionStatus.authentication = false;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/core/src/commands/ui/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export default class Deploy extends CLICommand {

@Trackable()
@Preconditions(
IsAuthenticated([AuthenticationType.OAuth]),
IsAuthenticated([AuthenticationType.OAuth, AuthenticationType.ApiKey]),
HasNecessaryCoveoPrivileges(createSearchPagesPrivilege)
)
public async run() {
Expand Down

0 comments on commit d296470

Please sign in to comment.