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

secure rest tests for threat intel monitor apis #1212

Merged

Conversation

eirsep
Copy link
Member

@eirsep eirsep commented Aug 1, 2024

Description

Adds secure rest tests for threat intel monitor APIs

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.


static String TEST_IT_BACKEND_ROLE = "IT";

static Map<String, String> roleToPermissionsMap = Map.ofEntries(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not needed

Copy link
Member Author

Choose a reason for hiding this comment

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

removed

);

private RestClient userClient;
private final String user = "userDetector";
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: rename from detectore

Copy link
Member Author

Choose a reason for hiding this comment

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

done

deleteUser(user);
}

private final String iocIndexMappings = "\"properties\": {\n" +
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wondering if there's a better way to go about getting the mappings for an index; I think we're essentially copying the mappings for a couple of tests. Perhaps a helper method that can get the mappings from the json resource files, and extract out just the properties?

Copy link
Member Author

Choose a reason for hiding this comment

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

removed this altogether

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
@eirsep eirsep force-pushed the threat-intel-monitor-secure-tests branch from 30398db to 1bbb0ae Compare August 9, 2024 20:54
@jowg-amazon jowg-amazon merged commit 15b40db into opensearch-project:main Sep 3, 2024
16 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 3, 2024
* secure tests for threat intel monitor apis

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* address review comments

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

---------

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
(cherry picked from commit 15b40db)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants