Class GlobusNamespacesParser
java.lang.Object
eu.emi.security.authn.x509.helpers.ns.GlobusNamespacesParser
- All Implemented Interfaces:
NamespacesParser
Parses a single .signing_policy file and returns
NamespacePolicy
object.
Only the simplified parsing of the EACL format is implemented, in a similar way is in case
of a native Globus implementation. However there are differences. First of all the format
of this file is defined in a very imprecise way.
The parsing is done in the following way:
- as a whitespace the space and tab characters are used; a separator may contain an arbitrary number of those, below only one space was used for clarity.
- all empty lines, whitespace only lines and lines beginning with '#' are ignored
- the first line like this is searched: access_id_CA X509 'ANY_STRING' other are ignored. Line with the access_id_CA prefix and other ending causes an error.
- after this line it is expected that the next significant line is : pos_rights globus CA:sign
- next the line in the format: cond_subjects globus '"ANY_STRING" ["ANY_STRING"]' is expected. The trailing string need not to be enclosed in '' and in "", but if it is then the order of quotation must be preserved.
- go to step 3.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
private static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addPermitted
(String permitted) private int
eatSpaces
(char[] string, int offset, boolean atLeastOne) private int
getQuoted
(char[] string, int offset, char quoteChar, StringBuilder ret) private void
handleAuthEntry
(String line, BufferedReader reader) private void
handleCABlock
(String line, BufferedReader reader) private void
handlePermitEntry
(String line, BufferedReader reader) private boolean
static String
makeRegexpClassicWildcard
(String pattern) Converts wildcard string to Java regexp, ensuring that literal sequences are correctly escaped.static String
parse()
private GlobusNamespacesParser.Token
parseNextTokenUntil
(char[] string, int offset, char delimiter)
-
Field Details
-
ACCESS_ID_CA
-
DEF_AUTH_X509
-
DEF_AUTH_GLOBUS
-
POS_RIGHTS
-
CONDITION_SUBJECT
-
VALUE_CA_SIGN
-
NS_REGEXP
- See Also:
-
filePath
-
hash
-
issuer
-
ret
-
-
Constructor Details
-
GlobusNamespacesParser
-
-
Method Details
-
parse
- Specified by:
parse
in interfaceNamespacesParser
- Throws:
IOException
-
handleCABlock
- Throws:
IOException
-
handleAuthEntry
- Throws:
IOException
-
handlePermitEntry
- Throws:
IOException
-
addPermitted
- Throws:
IOException
-
getQuoted
private int getQuoted(char[] string, int offset, char quoteChar, StringBuilder ret) throws IOException - Throws:
IOException
-
isValid
-
eatSpaces
- Throws:
IOException
-
parseNextTokenUntil
private GlobusNamespacesParser.Token parseNextTokenUntil(char[] string, int offset, char delimiter) throws GlobusNamespacesParser.PolicySyntaxException -
normalize
-
makeRegexpClassicWildcard
Converts wildcard string to Java regexp, ensuring that literal sequences are correctly escaped.- Parameters:
pattern
- input wildcard- Returns:
- Java regular expression
-