-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BE: Implement audit log level (#4103)
- Loading branch information
Showing
17 changed files
with
213 additions
and
20 deletions.
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
12 changes: 11 additions & 1 deletion
12
kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/rbac/permission/AclAction.java
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 |
---|---|---|
@@ -1,15 +1,25 @@ | ||
package com.provectus.kafka.ui.model.rbac.permission; | ||
|
||
import java.util.Set; | ||
import org.apache.commons.lang3.EnumUtils; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public enum AclAction implements PermissibleAction { | ||
|
||
VIEW, | ||
EDIT; | ||
EDIT | ||
|
||
; | ||
|
||
public static final Set<AclAction> ALTER_ACTIONS = Set.of(EDIT); | ||
|
||
@Nullable | ||
public static AclAction fromString(String name) { | ||
return EnumUtils.getEnum(AclAction.class, name); | ||
} | ||
|
||
@Override | ||
public boolean isAlter() { | ||
return ALTER_ACTIONS.contains(this); | ||
} | ||
} |
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
12 changes: 11 additions & 1 deletion
12
kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/rbac/permission/AuditAction.java
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 |
---|---|---|
@@ -1,14 +1,24 @@ | ||
package com.provectus.kafka.ui.model.rbac.permission; | ||
|
||
import java.util.Set; | ||
import org.apache.commons.lang3.EnumUtils; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public enum AuditAction implements PermissibleAction { | ||
|
||
VIEW; | ||
VIEW | ||
|
||
; | ||
|
||
private static final Set<AuditAction> ALTER_ACTIONS = Set.of(); | ||
|
||
@Nullable | ||
public static AuditAction fromString(String name) { | ||
return EnumUtils.getEnum(AuditAction.class, name); | ||
} | ||
|
||
@Override | ||
public boolean isAlter() { | ||
return ALTER_ACTIONS.contains(this); | ||
} | ||
} |
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
8 changes: 7 additions & 1 deletion
8
...i-api/src/main/java/com/provectus/kafka/ui/model/rbac/permission/ConsumerGroupAction.java
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 |
---|---|---|
@@ -1,20 +1,26 @@ | ||
package com.provectus.kafka.ui.model.rbac.permission; | ||
|
||
import java.util.Set; | ||
import org.apache.commons.lang3.EnumUtils; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public enum ConsumerGroupAction implements PermissibleAction { | ||
|
||
VIEW, | ||
DELETE, | ||
|
||
RESET_OFFSETS | ||
|
||
; | ||
|
||
public static final Set<ConsumerGroupAction> ALTER_ACTIONS = Set.of(DELETE, RESET_OFFSETS); | ||
|
||
@Nullable | ||
public static ConsumerGroupAction fromString(String name) { | ||
return EnumUtils.getEnum(ConsumerGroupAction.class, name); | ||
} | ||
|
||
@Override | ||
public boolean isAlter() { | ||
return ALTER_ACTIONS.contains(this); | ||
} | ||
} |
11 changes: 10 additions & 1 deletion
11
kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/rbac/permission/KsqlAction.java
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 |
---|---|---|
@@ -1,15 +1,24 @@ | ||
package com.provectus.kafka.ui.model.rbac.permission; | ||
|
||
import java.util.Set; | ||
import org.apache.commons.lang3.EnumUtils; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public enum KsqlAction implements PermissibleAction { | ||
|
||
EXECUTE; | ||
EXECUTE | ||
|
||
; | ||
|
||
public static final Set<KsqlAction> ALTER_ACTIONS = Set.of(EXECUTE); | ||
|
||
@Nullable | ||
public static KsqlAction fromString(String name) { | ||
return EnumUtils.getEnum(KsqlAction.class, name); | ||
} | ||
|
||
@Override | ||
public boolean isAlter() { | ||
return ALTER_ACTIONS.contains(this); | ||
} | ||
} |
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
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
Oops, something went wrong.