Github user tgravescs commented on a diff in the pull request:
https://github.com/apache/spark/pull/1196#discussion_r14291718
--- Diff: core/src/main/scala/org/apache/spark/SecurityManager.scala ---
@@ -169,18 +192,43 @@ private[spark] class SecurityManager(sparkConf:
SparkConf) extends Logging {
)
}
- private[spark] def setViewAcls(defaultUsers: Seq[String], allowedUsers:
String) {
- viewAcls = (defaultUsers ++
allowedUsers.split(',')).map(_.trim()).filter(!_.isEmpty).toSet
+ /**
+ * Split a comma separated String, filter out any empty items, and
return a Set of strings
+ */
+ private def stringToSet(list: String): Set[String] = {
+ (list.split(',')).map(_.trim()).filter(!_.isEmpty).toSet
+ }
+
+ private[spark] def setViewAcls(defaultUsers: Set[String], allowedUsers:
String) {
+ viewAcls = (adminAcls ++ defaultUsers ++ stringToSet(allowedUsers))
logInfo("Changing view acls to: " + viewAcls.mkString(","))
}
private[spark] def setViewAcls(defaultUser: String, allowedUsers:
String) {
- setViewAcls(Seq[String](defaultUser), allowedUsers)
+ setViewAcls(Set[String](defaultUser), allowedUsers)
+ }
+
+ private[spark] def getViewAcls: String = viewAcls.mkString(",")
+
+ private[spark] def setModifyAcls(defaultUsers: Set[String],
allowedUsers: String) {
+ modifyAcls = (adminAcls ++ defaultUsers ++ stringToSet(allowedUsers))
--- End diff --
yes it requires it set before. I went back and forth on this a bit and
choose to keep it this way since its private and only really called in once
place at this point (history ui). And actually only the view one is called
the modify one isn't called anywhere outside of this class. We could add the
additional logic but I kind of see it as just overhead right now. Normally
everything is initialized just when you create the securityManager and so these
routines aren't called outside of here.
I could be swayed to change it. I should atleast add a comment here also.
I have it in some other places, but should add here too.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---