-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Register event listeners for default system access control #11632
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -139,7 +139,7 @@ public void loadSystemAccessControl() | |
| List<File> configFiles = this.configFiles; | ||
| if (configFiles.isEmpty()) { | ||
| if (!CONFIG_FILE.exists()) { | ||
| setSystemAccessControl(defaultAccessControlName, ImmutableMap.of()); | ||
| loadSystemAccessControl(defaultAccessControlName, ImmutableMap.of()); | ||
| log.info("Using system access control: %s", defaultAccessControlName); | ||
| return; | ||
| } | ||
|
|
@@ -187,7 +187,7 @@ private SystemAccessControl createSystemAccessControl(File configFile) | |
| } | ||
|
|
||
| @VisibleForTesting | ||
| protected void setSystemAccessControl(String name, Map<String, String> properties) | ||
| public void loadSystemAccessControl(String name, Map<String, String> properties) | ||
| { | ||
| requireNonNull(name, "name is null"); | ||
| requireNonNull(properties, "properties is null"); | ||
|
|
@@ -200,6 +200,9 @@ protected void setSystemAccessControl(String name, Map<String, String> propertie | |
| systemAccessControl = factory.create(ImmutableMap.copyOf(properties)); | ||
| } | ||
|
|
||
| systemAccessControl.getEventListeners() | ||
| .forEach(eventListenerManager::addEventListener); | ||
|
Comment on lines
+203
to
+204
Contributor
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. I would move it to the no-argument But then you'll have to change
Member
Author
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. But then we would need to move out Also in a way
Contributor
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. OK then. This was my thought from looking around the code, as I wanted to understand the context of this change. |
||
|
|
||
| setSystemAccessControls(ImmutableList.of(systemAccessControl)); | ||
| } | ||
|
|
||
|
|
||
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.
If it's
public, does the@VisibleForTestingstill make sense?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.
I think so. It's being used only in tests other than this class itself