Add a field on Repository for storing a UUID for incoming webhooks.

Review Request #6310 — Created Sept. 10, 2014 and submitted

Information

Review Board
release-2.0.x
5705247...

Reviewers

This adds new Repository.hooks_uuid, which is used for matching and
validating incoming webhooks. How this is used is up to the hook
implementation, and can be part of the URL, part of HMAC validation,
or whatever else makes sense.

This field is not exposed in the API. It will instead be used by the
various HostingServices in whichever way makes the most sense for their
implementation, and exposed to the user through an upcoming change that
will allow them to provide hook instructions.

Made use of the field and functions in another change.

Description From Last Updated

redefinition of unused 'six' from line 13

reviewbotreviewbot

Why isn't this using the uuid module?

daviddavid
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/scmtools/evolutions/__init__.py
        reviewboard/scmtools/models.py
        reviewboard/scmtools/evolutions/repository_hooks_uuid.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/scmtools/evolutions/__init__.py
        reviewboard/scmtools/models.py
        reviewboard/scmtools/evolutions/repository_hooks_uuid.py
    
    
  2. reviewboard/scmtools/models.py (Diff revision 1)
     
     
    Show all issues
     redefinition of unused 'six' from line 13
    
  3. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/scmtools/evolutions/__init__.py
        reviewboard/scmtools/models.py
        reviewboard/scmtools/evolutions/repository_hooks_uuid.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/scmtools/evolutions/__init__.py
        reviewboard/scmtools/models.py
        reviewboard/scmtools/evolutions/repository_hooks_uuid.py
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/scmtools/models.py (Diff revision 2)
     
     
     
     
    Show all issues

    Why isn't this using the uuid module?

    1. I copy/pasted the bulk of this from the WebAPIToken generation code, which was based on other implementations I saw. Those were using the above trick and not using the UUID module. When I first looked into this, I saw this from RFC 4122:

      Do not assume that UUIDs are hard to guess; they should not be used
      as security capabilities (identifiers whose mere possession grants
      access), for example. A predictable random number source will
      exacerbate the situation.

      I looked around tonight for opinions on this. The Openstack security team clarified this, saying that that section does not apply to UUID v4.

      I'll go ahead and update this.

  3. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/scmtools/evolutions/__init__.py
        reviewboard/scmtools/models.py
        reviewboard/scmtools/evolutions/repository_hooks_uuid.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/scmtools/evolutions/__init__.py
        reviewboard/scmtools/models.py
        reviewboard/scmtools/evolutions/repository_hooks_uuid.py
    
    
  2. 
      
chipx86
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/scmtools/admin.py
        reviewboard/scmtools/models.py
        reviewboard/scmtools/evolutions/__init__.py
        reviewboard/scmtools/evolutions/repository_hooks_uuid.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/scmtools/admin.py
        reviewboard/scmtools/models.py
        reviewboard/scmtools/evolutions/__init__.py
        reviewboard/scmtools/evolutions/repository_hooks_uuid.py
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (b6e332d)