-
Notifications
You must be signed in to change notification settings - Fork 129
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
model access control changes rebased to 2.x #902
Merged
zane-neo
merged 11 commits into
opensearch-project:model-access-control-dev
from
rbhavna:model-access-control
May 23, 2023
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b8957bc
Backport changes to model-access-control feature branch (#837)
ylwu-amzn 01f7f5e
add model group (#840)
ylwu-amzn f6c8780
access validation for register/update model-group, register/get/delet…
rbhavna 3c99d7c
changes to security utils and register/search model group
rbhavna e41cc1d
update last_updated_time in model group when new version added
rbhavna 112934d
fix undeploy model action
rbhavna 0aad57e
fix format violations
rbhavna 91ca331
rebased to 2.x and prediction/search API fix
rbhavna 29a0241
fix rebase conflicts
rbhavna e54e399
new delete model group API
rbhavna 55295ee
fix formal violations
rbhavna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,9 +27,10 @@ public class CommonValue { | |
public static String HOT_BOX_TYPE = "hot"; | ||
// warm node | ||
public static String WARM_BOX_TYPE = "warm"; | ||
|
||
public static final String ML_MODEL_GROUP_INDEX = ".plugins-ml-model-group"; | ||
public static final String ML_MODEL_INDEX = ".plugins-ml-model"; | ||
public static final String ML_TASK_INDEX = ".plugins-ml-task"; | ||
public static final Integer ML_MODEL_GROUP_INDEX_SCHEMA_VERSION = 1; | ||
public static final Integer ML_MODEL_INDEX_SCHEMA_VERSION = 4; | ||
public static final Integer ML_TASK_INDEX_SCHEMA_VERSION = 1; | ||
public static final String USER_FIELD_MAPPING = " \"" | ||
|
@@ -43,6 +44,48 @@ public class CommonValue { | |
+ " \"custom_attribute_names\": {\"type\":\"text\", \"fields\":{\"keyword\":{\"type\":\"keyword\"}}}\n" | ||
+ " }\n" | ||
+ " }\n"; | ||
public static final String ML_MODEL_GROUP_INDEX_MAPPING = "{\n" + | ||
" \"_meta\": {\n" + | ||
" \"schema_version\": "+ML_MODEL_GROUP_INDEX_SCHEMA_VERSION+"\n" + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor : add whitespace before and after |
||
" },\n" + | ||
" \"properties\": {\n" + | ||
" \""+MLModelGroup.MODEL_GROUP_NAME_FIELD+"\": {\n" + | ||
" \"type\": \"text\",\n" + | ||
" \"fields\": {\n" + | ||
" \"keyword\": {\n" + | ||
" \"type\": \"keyword\",\n" + | ||
" \"ignore_above\": 256\n" + | ||
" }\n" + | ||
" }\n" + | ||
" },\n" + | ||
" \""+MLModelGroup.DESCRIPTION_FIELD+"\": {\n" + | ||
" \"type\": \"text\"\n" + | ||
" },\n" + | ||
" \""+MLModelGroup.LATEST_VERSION_FIELD+"\": {\n" + | ||
" \"type\": \"integer\"\n" + | ||
" },\n" + | ||
" \""+MLModelGroup.MODEL_GROUP_ID_FIELD+"\": {\n" + | ||
" \"type\": \"keyword\"\n" + | ||
" },\n" + | ||
" \""+MLModelGroup.ACCESS+"\": {\n" + | ||
" \"type\": \"keyword\"\n" + | ||
" },\n" + | ||
" \""+MLModelGroup.OWNER+"\": {\n" + | ||
" \"type\": \"nested\",\n" + | ||
" \"properties\": {\n" + | ||
" \"name\": {\"type\":\"text\", \"fields\":{\"keyword\":{\"type\":\"keyword\", \"ignore_above\":256}}},\n" + | ||
" \"backend_roles\": {\"type\":\"text\", \"fields\":{\"keyword\":{\"type\":\"keyword\"}}},\n" + | ||
" \"roles\": {\"type\":\"text\", \"fields\":{\"keyword\":{\"type\":\"keyword\"}}},\n" + | ||
" \"custom_attribute_names\": {\"type\":\"text\", \"fields\":{\"keyword\":{\"type\":\"keyword\"}}}\n" + | ||
" }\n" + | ||
" },\n" + | ||
" \""+MLModelGroup.CREATED_TIME_FIELD+"\": {\n" + | ||
" \"type\": \"date\", \"format\": \"strict_date_time||epoch_millis\"},\n" + | ||
" \""+MLModelGroup.LAST_UPDATED_TIME_FIELD+"\": {\n" + | ||
" \"type\": \"date\", \"format\": \"strict_date_time||epoch_millis\"}\n" + | ||
" }\n" + | ||
"}"; | ||
|
||
public static final String ML_MODEL_INDEX_MAPPING = "{\n" | ||
+ " \"_meta\": {\"schema_version\": " | ||
+ ML_MODEL_INDEX_SCHEMA_VERSION | ||
|
@@ -61,6 +104,9 @@ public class CommonValue { | |
+ MLModel.MODEL_VERSION_FIELD | ||
+ "\" : {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_GROUP_ID_FIELD | ||
+ "\" : {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_CONTENT_FIELD | ||
+ "\" : {\"type\": \"binary\"},\n" | ||
+ " \"" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rbhavna I don't see
tags
field inML_MODEL_GROUP_INDEX_MAPPING
. As tags will be key value pairs, suggest take a look at flat object