Gridmap

From Globus

Contents

Globus Toolkit Gridmap Processing

Purpose of this document

This document is an attempt to gather details about the various gridmap file parsing implementations, and produce a standard grammar which defines the contents of a grid-mapfile.

GSI Java (CoG JGlobus) Grid map file processing

Algorithm to load grid map file

  1. File is read in one line at a time. A line is considered to be terminated by any one of a line feed ("\n"), a carriage return ("\r"), or a carriage return followed immediately by a linefeed ("\r\n").
  2. If line has just white space, processing continues to next line.
  3. If first character of line is # processing continues to next line.
  4. The line is parsed to read in DN using the steps below. A start index of 0 is used.
    1. All leading white spaces
    2. If character at start index is double quote (") or single quote ('), text until corresponding close quotes is read. Any character between escaped with back slash (\) is also read in, with the escape character (\) omitted.
    3. If character at start index is neither of the quotes, then all characters till the first white space is read. All characters are read in as is, no escape algorithm.
  5. DN retrieved is normalized
    1. If DN has "/e=" or "/E=", it is replaced with "/emailAddress"
    2. If DN has "/Email=", it is replaced with "/emailAddress". The comparison is NOT case sensitive.
    3. If DN has "/uid=", it is replaced with "/userid=". The comparison is NOT case sensitive.
  6. The list of usernames is read in using the same steps as 5a to 5b, with start index set to the length of token in 5 plus 1.
    1. The string from 7 is split with comma as separator.

Error reporting

  1. In trunk and 4.0 branch of CoG JGlobus
    1. By default errors are not ignored.
    2. If ignore errors flag is set to true, a warning per erroneous line is printed and parsing continues.
  2. In community branch, by default errors are set to be ignored.

GSI C Grid map file processing 4.0.x and 4.2.0

  1. File is read one line at a time (until \n), with a maximum line length of 1023 bytes
    1. Leading whitespace is skipped
    2. If the remaining line begins with # it is ignored
    3. If the remaining line is empty, it is ignored
    4. If the remaining line begins with ", end of DN is located by searching for first non-escaped double-quote
    5. Else, end of DN is the 1st whitespace character (" \t\n")
    6. The DN is parsed. In either case (quoted or unquoted) escaped characters are handled in the DN parsing code. Hex escapes are supported: (\xfe = (char) 0xfe), otherwise the character after the escape is copied literally to the output.
    7. whitespace after the DN is skipped
    8. userid from current point in parsing until whitespace or , is copied to output. this continues until EOL

Proposed ABNF grammar for Gridmap Files

grid-map-file = *grid-map-line
grid-map-line = *WSP [ comment / mapping ] *WSP eol
eol = CR / LF / CRLF
comment = # *(ALPHA / DIGIT / WSP)
mapping = distinguished-name 1*WSP local-name-list
distinguished-name = DQUOTE 1*dn-component DQUOTE / "'" 1*dn-component "'"
dn-component = "/" component-name "=" component-value
component-name = 1*(ALPHA / DIGIT)
component-value = 1*(ALPHA / DIGIT / WSP / punctuation / escaped-quote )
punctuation = "/" / "," / "." / "@" / "(" / ")"
escaped-quote = "\" DQUOTE
local-name-list = local-name *("," local-name-list)
local-name = 1*(ALPHA DIGIT)

Additional Processing Rules

  • Default local user name returned should be the first username

Example Grid map entries

"/O=Grid/O=Globus/OU=mcs.anl.gov/CN=Katarzyna (Kate) Keahey" keahey,kate
"/O=Grid/O=Globus/OU=mcs.anl.gov/CN=Michael Dvorak" dvorak2
"/DC=org/DC=doegrids/OU=People/UID=3284532/USERID=7878/UID=8989/E=john@doe.com" john_doe
"/DC=org/DC=doegrids/OU=People/UID=32845/Email=john@doe.com/Email=another@doe.edu"  doe
"/DC=org/DC=doegrids/OU=Services/Email=admin@mcs/CN=host/effable.mcs.anl.gov" host\n" user1DN user1
# This is a comment
"/O=myCA/CN=\\\"Foo Bar\\\"" account
Personal tools
Execution Projects
Information projects
Distribution Projects
Documentation Projects
Deprecated