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 identity/authorization headers into Rest Client calls #430

Closed
dbwiddis opened this issue Feb 10, 2023 · 6 comments
Closed
Assignees
Labels
CCI Part of the College Contributor Initiative enhancement New feature or request good first issue Good for newcomers

Comments

@dbwiddis
Copy link
Member

dbwiddis commented Feb 10, 2023

Is your feature request related to a problem?

Presently SDKClient rest calls do not include security features. Upcoming integration of identity features will include authentication and/or identity tokens that will need to be included with REST requests via the client.

See opensearch-project/OpenSearch#3846

What solution would you like?

SDKClient REST calls need to edit the RequestOptions to add headers.

There may be a need to close/re-initialize the clients or just change the headers, that will need to be determined later.

@dbwiddis dbwiddis added the enhancement New feature or request label Feb 10, 2023
@kokibas
Copy link
Contributor

kokibas commented Mar 20, 2023

Hello @dbwiddis , I would like to take this issue

@dbwiddis
Copy link
Member Author

Hey @kokibas happy for you to work on this, but I'll be honest the requirement is a little vague here. Let me know if you have any questions!

@kokibas
Copy link
Contributor

kokibas commented Mar 23, 2023

@dbwiddis have identity features been completed?

@kokibas
Copy link
Contributor

kokibas commented Mar 24, 2023

Hello @dbwiddis ,I wanted to ask In order to change Request Options and add headers, I need to call the "toBuilder()" method of the RequestOptions class in SDKClient class , creating a new instance of the Builder class containing the current parameters that can be changed. Then I have to call the Builder methods to add headers to Request Options. Finally, the modified Request Options can be set in the request by calling the "set Request Options()" method.Can you tell me if I understood the task correctly.

@dbwiddis dbwiddis added the CCI Part of the College Contributor Initiative label Mar 24, 2023
@dbwiddis
Copy link
Member Author

Hello @dbwiddis ,I wanted to ask In order to change Request Options and add headers, I need to call the "toBuilder()" method of the RequestOptions class in SDKClient class , creating a new instance of the Builder class containing the current parameters that can be changed. Then I have to call the Builder methods to add headers to Request Options. Finally, the modified Request Options can be set in the request by calling the "set Request Options()" method.Can you tell me if I understood the task correctly.

Yes, I believe that is the correct approach. Here is code in a test class doing that.

@dbwiddis
Copy link
Member Author

Done in #613

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCI Part of the College Contributor Initiative enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants