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

[FEATURE] Add support for passing headers when writing tests #438

Closed
DarshitChanpura opened this issue Jul 18, 2024 · 4 comments · Fixed by #461
Closed

[FEATURE] Add support for passing headers when writing tests #438

DarshitChanpura opened this issue Jul 18, 2024 · 4 comments · Fixed by #461
Assignees
Labels
enhancement New feature or request

Comments

@DarshitChanpura
Copy link
Member

DarshitChanpura commented Jul 18, 2024

Is your feature request related to a problem?

This feature requests modification of the test framework currently implemented to allow usage of headers when writing tests. This would allow for usage of credentials other than admin when writing tests. This would grant more flexibility especially for security related APIs.

What solution would you like?

  • ability to use credentials other than admin when writing tests for APIs.
  - synopsis: Change password.
    path: /_plugins/_security/api/account
    method: PUT
    headers:
      authorization: "Basic <base64-encoded-string>"   <----
    request_body:
      payload:
        current_password: "myWeakPassword123!"
        password: "myStrongPassword123!"
    response:
      status: 200
@DarshitChanpura DarshitChanpura added enhancement New feature or request untriaged labels Jul 18, 2024
@DarshitChanpura DarshitChanpura changed the title [FEATURE] Add support for using a different credentials than admin when writing tests [FEATURE] Add support for passing headers when writing tests Jul 18, 2024
@nhtruong
Copy link
Collaborator

Since the username and password can be included in the headers for authorization, we should add the ability to specify the headers in test stories. It will be needed in the future and will also resolve this.

@dblock what do you think?

@dblock
Copy link
Member

dblock commented Jul 18, 2024

@nhtruong Good idea, any headers would overwrite the ones we send otherwise.

@dblock dblock self-assigned this Aug 1, 2024
@dblock
Copy link
Member

dblock commented Aug 1, 2024

I'll take this one.

@dblock
Copy link
Member

dblock commented Aug 1, 2024

#461

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants