Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-13237

Implement authentication via access token in lsst.verify

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Make sure dispatch_verify works with the new SQuaSH API, for example authentication is done via JWT token now. See an example here https://github.com/lsst-sqre/squash-rest-api/blob/master/tests/test_api.ipynb

      We need new methods in lsst.verify to get the access token from the SQuaSH API and make an Authorization header.

        Attachments

          Issue Links

            Activity

            Hide
            afausti Angelo Fausti added a comment -

            Follow instructions on how to install the stack using the lsstsw method:

            cd lsstsw
            source bin/setup.sh
            

            Clone and setup the verify package to test the changes implemented in this ticket:

            git clone https://github.com/lsst/verify
            cd verify
            git checkout tickets/DM-13237
             
            setup -r . -t $USER
            scons -Q -j 6 opt=3
            

            Show
            afausti Angelo Fausti added a comment - Follow instructions on how to install the stack using the lsstsw method : cd lsstsw source bin/setup.sh Clone and setup the verify package to test the changes implemented in this ticket: git clone https://github.com/lsst/verify cd verify git checkout tickets/DM-13237 setup -r . -t $USER scons -Q -j 6 opt=3
            Hide
            afausti Angelo Fausti added a comment - - edited

            lsst.verify assumes API URLs can be discovered from the API root, so I've changed the behaviour of the root resource to provide that, including the /auth URL needed to obtain the JWT access token. Merged PR 9 and redeployed SQuaSH RESTful API

            Show
            afausti Angelo Fausti added a comment - - edited lsst.verify assumes API URLs can be discovered from the API root, so I've changed the behaviour of the root  resource to provide that, including the  /auth  URL needed to obtain the JWT access token. Merged PR 9  and redeployed SQuaSH RESTful API
            Hide
            afausti Angelo Fausti added a comment - - edited

            Assuming you have a verify job JSON document, you can execute dispatch_verify from the lsstsw folder like so:

             

            $ dispatch_verify.py --url https://squash-restful-api-demo.lsst.codes --user nobody --password admin --env jenkins --lsstsw $(pwd) Cfht_output_r.json

             

             

            $ dispatch_verify.py --url https://squash-restful-api-demo.lsst.codes --user nobody --password admin --env jenkins --lsstsw $(pwd) Cfht_output_r.json
            verify.bin.dispatchverify.main INFO: Loading Cfht_output_r.json
            verify.bin.dispatchverify.main INFO: Refreshing metric definitions from verify_metrics
            verify.bin.dispatchverify.main INFO: Inserting lsstsw package metadata from /Users/afausti/Projects/lsstsw/lsstsw.
            verify.bin.dispatchverify.main INFO: Inserting Jenkins CI environment metadata.
            verify.bin.dispatchverify.main INFO: Uploading Job JSON to https://squash-restful-api-demo.lsst.codes.
            verify.squash.get INFO: GET https://squash-restful-api-demo.lsst.codes status: 200
            verify.squash.post INFO: POST https://squash-restful-api-demo.lsst.codes/auth status: 200
            verify.squash.post INFO: POST https://squash-restful-api-demo.lsst.codes/job status: 201
             
             
            

             

            Show
            afausti Angelo Fausti added a comment - - edited Assuming you have a verify job JSON document, you can execute dispatch_verify from the lsstsw folder like so:   $ dispatch_verify.py --url https: //squash-restful-api-demo.lsst.codes --user nobody --password admin --env jenkins --lsstsw $(pwd) Cfht_output_r.json     $ dispatch_verify.py --url https://squash-restful-api-demo.lsst.codes --user nobody --password admin --env jenkins --lsstsw $(pwd) Cfht_output_r.json verify.bin.dispatchverify.main INFO: Loading Cfht_output_r.json verify.bin.dispatchverify.main INFO: Refreshing metric definitions from verify_metrics verify.bin.dispatchverify.main INFO: Inserting lsstsw package metadata from /Users/afausti/Projects/lsstsw/lsstsw. verify.bin.dispatchverify.main INFO: Inserting Jenkins CI environment metadata. verify.bin.dispatchverify.main INFO: Uploading Job JSON to https://squash-restful-api-demo.lsst.codes. verify.squash.get INFO: GET https://squash-restful-api-demo.lsst.codes status: 200 verify.squash.post INFO: POST https://squash-restful-api-demo.lsst.codes/auth status: 200 verify.squash.post INFO: POST https://squash-restful-api-demo.lsst.codes/job status: 201      
            Hide
            afausti Angelo Fausti added a comment -
            Show
            afausti Angelo Fausti added a comment - See PR  https://github.com/lsst/verify/pull/22
            Hide
            afausti Angelo Fausti added a comment -

            Adressed PR suggestions and merged.

            Show
            afausti Angelo Fausti added a comment - Adressed PR suggestions and merged.

              People

              • Assignee:
                afausti Angelo Fausti
                Reporter:
                afausti Angelo Fausti
                Reviewers:
                Jonathan Sick
                Watchers:
                Angelo Fausti, Jonathan Sick
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel