File tree Expand file tree Collapse file tree 4 files changed +3
-95
lines changed
libs/agent-sm/agent-policy/src/main/java/org/opensearch/secure_sm/policy Expand file tree Collapse file tree 4 files changed +3
-95
lines changed Original file line number Diff line number Diff line change 7
7
*/
8
8
package org .opensearch .secure_sm .policy ;
9
9
10
- import java .io .PrintWriter ;
11
10
import java .util .Collections ;
12
11
import java .util .LinkedList ;
13
12
import java .util .List ;
@@ -23,30 +22,4 @@ public void add(PermissionEntry entry) {
23
22
public List <PermissionEntry > permissionElements () {
24
23
return Collections .unmodifiableList (permissionEntries );
25
24
}
26
-
27
- public void write (PrintWriter out ) {
28
- out .print ("grant" );
29
- if (codeBase != null ) {
30
- out .print (" Codebase \" " );
31
- out .print (codeBase );
32
- out .print ("\" " );
33
- }
34
- out .println (" {" );
35
- for (PermissionEntry pe : permissionEntries ) {
36
- out .print (" permission " );
37
- out .print (pe .permission );
38
- if (pe .name != null ) {
39
- out .print (" \" " );
40
- out .print (pe .name );
41
- out .print ("\" " );
42
- }
43
- if (pe .action != null ) {
44
- out .print (", \" " );
45
- out .print (pe .action );
46
- out .print ("\" " );
47
- }
48
- out .println (";" );
49
- }
50
- out .println ("};" );
51
- }
52
25
}
Original file line number Diff line number Diff line change 7
7
*/
8
8
package org .opensearch .secure_sm .policy ;
9
9
10
- import java .io .PrintWriter ;
11
10
import java .util .Objects ;
12
11
13
12
public class PermissionEntry {
@@ -29,20 +28,4 @@ public boolean equals(Object obj) {
29
28
&& Objects .equals (this .name , that .name )
30
29
&& Objects .equals (this .action , that .action );
31
30
}
32
-
33
- public void write (PrintWriter out ) {
34
- out .print ("permission " );
35
- out .print (permission );
36
- if (name != null ) {
37
- out .print (" \" " );
38
- out .print (name .replaceAll ("\\ \\ " , "\\ \\ \\ \\ " ).replaceAll ("\" " , "\\ \\ \\ \" " ));
39
- out .print ('"' );
40
- }
41
- if (action != null ) {
42
- out .print (", \" " );
43
- out .print (action );
44
- out .print ('"' );
45
- }
46
- out .println (";" );
47
- }
48
31
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 15
15
import java .io .IOException ;
16
16
import java .io .Reader ;
17
17
import java .io .StreamTokenizer ;
18
+ import java .util .ArrayList ;
18
19
import java .util .Collections ;
19
20
import java .util .List ;
20
21
import java .util .Optional ;
21
- import java .util .Vector ;
22
22
23
23
public class PolicyParser {
24
24
25
- private final Vector <GrantEntry > grantEntries = new Vector <>();
25
+ private final List <GrantEntry > grantEntries = Collections .synchronizedList (new ArrayList <>());
26
+
26
27
private TokenStream tokenStream ;
27
28
28
29
public PolicyParser () {}
You can’t perform that action at this time.
0 commit comments