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

Adding arbitrary metadata to a Knox Token

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.6.0
    • 2.0.0
    • Server
    • None

    Description

      We would need to enhance our GET API to accept an arbitrary list of key/value pairs as Knox token metadata. At the time of this Jira is being created, the following hard-coded metadata exists for a Knox Token:

      • userName
      • comment
      • enabled
      • passcode

      The plan is to modify our TokenResource to accept query parameters starting with the ‘md_’ prefix and treat them as Knox Token Metadata. For instance:

      curl -iku admin:admin-password -X GET 'https://localhost:8443/gateway/sandbox/knoxtoken/api/v1/token?md_notebookName=accountantKnoxToken&md_souldBeRemovedBy=31March2022&md_otherMeaningfuMetadata=KnoxIsCool'

      When such a token is created by Knox, we should save the following metadata too:

      • notebookName=accountantKnoxToken
      • shouldBeRemovedBy=31March2022
      • otherMeaningfulMetadata=KnoxIsCool

      It’s not only Knox will be able to save these metadata, but we have to update our existing getUserTokens API endpoint to be able to fetch basic token information (see org.apache.knox.gateway.services.security.token.KnoxToken) using the supplied metadata name besides the user name information.

      For instance:

      curl -iku admin:admin-password -X GET 'https://localhost:8443/gateway/sandbox/knoxtoken/api/v1/token/getUserTokens?userName=admin&mdName=notebookName&mdValue=accountantKnoxToken'

      will return all Knox tokens where metadata with ‘notebookName’ exists and equals ‘accountantKnoxToken’.

      Finally, the Token Management page should display metadata too.

      Attachments

        Issue Links

          Activity

            People

              smolnar Sandor Molnar
              smolnar Sandor Molnar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m