Uploaded image for project: 'Apache Knox'
  1. Apache Knox
  2. KNOX-579

Regex based identity assertion provider with static dictionary lookup

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.5.0
    • 0.7.0
    • Server
    • None

    Description

      I've been running into situations where customers need to do more complex identity mapping than the current providers can handle. I have a prototype that can do this sort of thing.

      Static

              <provider>
                  <role>federation</role>
                  <name>HeaderPreAuth</name>
                  <enabled>true</enabled>
              </provider>
      
              <provider>
                  <role>identity-assertion</role>
                  <name>Regex</name>
                  <enabled>true</enabled>
                  <param>
                      <name>output</name>
                      <value>static-user</value>
                  </param>
              </provider>
      

      This will yieid results like this

      curl -k --header "SM_USER: member@us.apache.org" 'https://localhost:8443/gateway/sandbox/webhdfs/v1?op=GETHOMEDIRECTORY'
      
      {"Path":"/user/static-user"}
      

      Regex

              <provider>
                  <role>federation</role>
                  <name>HeaderPreAuth</name>
                  <enabled>true</enabled>
              </provider>
      
              <provider>
                  <role>identity-assertion</role>
                  <name>Regex</name>
                  <enabled>true</enabled>
                  <param>
                      <name>input</name>
                      <value>(.*)@(.*?)\..*</value>
                  </param>
                  <param>
                      <name>output</name>
                      <value>{1}_{[2]}</value>
                  </param>
                  <param>
                      <name>lookup</name>
                      <value>us=USA;ca=CANADA</value>
                  </param>
              </provider>
      

      This will yield this type of results.

      curl -k --header "SM_USER: member@us.apache.org" 'https://localhost:8443/gateway/sandbox/webhdfs/v1?op=GETHOMEDIRECTORY'
      
      {"Path":"/user/member_USA"}
      
      url -k --header "SM_USER: member@ca.apache.org" 'https://localhost:8443/gateway/sandbox/webhdfs/v1?op=GETHOMEDIRECTORY'
      
      {"Path":"/user/member_CANADA"}
      

      Attachments

        1. KNOX-579-001.patch
          59 kB
          Kevin Minder

        Activity

          People

            kminder Kevin Minder
            kminder Kevin Minder
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: