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

Improve the ts_authorize code in several ways.

    XMLWordPrintable

    Details

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

      Description

      The ts_authorize code can be improved in several ways:

        Attachments

          Activity

          Hide
          wvreeven Wouter van Reeven added a comment -

          The use of the dataclasses proved not simple because of two reasons:

          • They are defined to also contain the validation data for the unit tests
          • Only part of the content is used in the rest of the code

          The first point I was able to resolve by separating the authorize request data and the validation data. I had to introduce a new dataclass for that. The second point would lead to more clutter in the code so I decided to keep things the way they are now.

          Show
          wvreeven Wouter van Reeven added a comment - The use of the dataclasses proved not simple because of two reasons: They are defined to also contain the validation data for the unit tests Only part of the content is used in the rest of the code The first point I was able to resolve by separating the authorize request data and the validation data. I had to introduce a new dataclass for that. The second point would lead to more clutter in the code so I decided to keep things the way they are now.
          Hide
          wvreeven Wouter van Reeven added a comment -

          Now dict are returned instead of setting the instance variables self.csc_failed_messages and self.cscs_succeeded. I had to reorganize part of the test code because it depended on the availability of those variables.

          Show
          wvreeven Wouter van Reeven added a comment - Now dict are returned instead of setting the instance variables self.csc_failed_messages and self.cscs_succeeded . I had to reorganize part of the test code because it depended on the availability of those variables.
          Hide
          wvreeven Wouter van Reeven added a comment -

          Extracted the WebServer code from the test classes so it can be reused by them.

          Show
          wvreeven Wouter van Reeven added a comment - Extracted the WebServer code from the test classes so it can be reused by them.
          Hide
          wvreeven Wouter van Reeven added a comment -

          I did not update the version history, since this PR is for code improvements and not for added or modified functionality.

          ts_authorize PR: https://github.com/lsst-ts/ts_authorize/pull/13

          Show
          wvreeven Wouter van Reeven added a comment - I did not update the version history, since this PR is for code improvements and not for added or modified functionality. ts_authorize PR: https://github.com/lsst-ts/ts_authorize/pull/13
          Hide
          rowen Russell Owen added a comment -

          Looks good. Making separate classes for authorize request data and that-plus-expected-results seems like a useful change.

          Show
          rowen Russell Owen added a comment - Looks good. Making separate classes for authorize request data and that-plus-expected-results seems like a useful change.

            People

            Assignee:
            wvreeven Wouter van Reeven
            Reporter:
            wvreeven Wouter van Reeven
            Reviewers:
            Russell Owen
            Watchers:
            Russell Owen, Wouter van Reeven
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.