Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oauth2 provider #133

Merged
merged 46 commits into from
May 8, 2024
Merged

Oauth2 provider #133

merged 46 commits into from
May 8, 2024

Commits on May 5, 2024

  1. Add oauth2 provider application

    john-westcott-iv authored and relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    206ef80 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6e33c5a View commit details
    Browse the repository at this point in the history
  3. Regen migrations for common changes

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    d3605ab View commit details
    Browse the repository at this point in the history
  4. Tighten up is_external_account() and fix tests

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    60b4cd1 View commit details
    Browse the repository at this point in the history
  5. fix import alias

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    90c821b View commit details
    Browse the repository at this point in the history
  6. I regret everything.

    Revert "Regen migrations for common changes"
    
    This reverts commit 53b7fb6.
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    e8f8329 View commit details
    Browse the repository at this point in the history
  7. Try fixing up migrations while not squashing them

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    a65cc9b View commit details
    Browse the repository at this point in the history
  8. Start on application tests

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    e1188fb View commit details
    Browse the repository at this point in the history
  9. Port a few tests from AWX

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    e7dcb01 View commit details
    Browse the repository at this point in the history
  10. Port another test

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    67f7ffc View commit details
    Browse the repository at this point in the history
  11. ... And this is why we test :)

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    72a02d1 View commit details
    Browse the repository at this point in the history
  12. Rework application serializer a bit, client_secret

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    edc486c View commit details
    Browse the repository at this point in the history
  13. Get "related" working for application tokens

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    d25de4f View commit details
    Browse the repository at this point in the history
  14. Create an OAuth2Application in demo data

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    4304f2e View commit details
    Browse the repository at this point in the history
  15. Add simple tests showing token auth works

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    9898ac0 View commit details
    Browse the repository at this point in the history
  16. Don't treat Application.client_secret as encrypted

    In newer DOT than what AWX uses, Application.client_secret is hashed
    automatically with no way to disable that functionality.
    
    There's a PR that allows for disabling that functionality ([0]), but
    that hasn't made it into a release.
    
    The DOT hashing is incompatible with our standard encryption - when
    DOT gets the value it ends up getting our encrypted string and trying
    to act on that. Ideally we'd like to disable their hashing entirely
    and use our standard encryption tooling.
    
    AWX avoids this problem by pinning to an older DOT.
    
    For now in DAB we'll just use the upstream hashing, and not treat the
    field as an encrypted_fields field to avoid the "double encryption"
    issue.
    
    [0]: jazzband/django-oauth-toolkit#1311
    
    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    586efbc View commit details
    Browse the repository at this point in the history
  17. Make is_external_account return the authenticator

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    c437d9b View commit details
    Browse the repository at this point in the history
  18. Show the proper authenticator type in error

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    b0e2e51 View commit details
    Browse the repository at this point in the history
  19. Welp, that took a while.

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    c68aa76 View commit details
    Browse the repository at this point in the history
  20. Finish test_token tests

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    41c5e57 View commit details
    Browse the repository at this point in the history
  21. Tidy up another test file

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    7c51b36 View commit details
    Browse the repository at this point in the history
  22. Update fixture tuple application fixtures return

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    a2f7420 View commit details
    Browse the repository at this point in the history
  23. Track oauth models in activity stream and sanitize

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    adb478f View commit details
    Browse the repository at this point in the history
  24. Provide view-level hook for extra related fields

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    84ca302 View commit details
    Browse the repository at this point in the history
  25. Start on /users/PK/<oauth stuff>/ endpoints

    Particularly, start on /users/PK/personal_tokens/
    
    No tests, yet.
    
    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    46551be View commit details
    Browse the repository at this point in the history
  26. Some coverage for the PAT mixin hack

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    87dc7d0 View commit details
    Browse the repository at this point in the history
  27. Nix updated/created from token model

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    d3269af View commit details
    Browse the repository at this point in the history
  28. Nix DOT updated/created fields from some models

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    6e70130 View commit details
    Browse the repository at this point in the history
  29. Use the API for the token fixture

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    7bc557c View commit details
    Browse the repository at this point in the history
  30. Clean up migrations

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    25cef53 View commit details
    Browse the repository at this point in the history
  31. Start a doc for differences from AWX

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    4dc5d82 View commit details
    Browse the repository at this point in the history
  32. Make summary fields useful for Application

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    97501de View commit details
    Browse the repository at this point in the history
  33. Get /users/N/authorized_tokens/ working

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    96d616a View commit details
    Browse the repository at this point in the history
  34. Just hardcode the user model basename in the mixin

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    5c179d4 View commit details
    Browse the repository at this point in the history
  35. We can't check user actions when we add more

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    0370e76 View commit details
    Browse the repository at this point in the history
  36. Finish porting AWX tests over

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 5, 2024
    Configuration menu
    Copy the full SHA
    243060a View commit details
    Browse the repository at this point in the history

Commits on May 7, 2024

  1. Use CommonModel fields for created and modified

    We have to use the right order of inheritance for this to work, and
    not null out fields that we actually want :)
    
    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 7, 2024
    Configuration menu
    Copy the full SHA
    33754a2 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2024

  1. Nix dependency LB

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 8, 2024
    Configuration menu
    Copy the full SHA
    3e685c3 View commit details
    Browse the repository at this point in the history
  2. Use wildcard

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 8, 2024
    Configuration menu
    Copy the full SHA
    f43a778 View commit details
    Browse the repository at this point in the history
  3. s/access/refresh/

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 8, 2024
    Configuration menu
    Copy the full SHA
    f825464 View commit details
    Browse the repository at this point in the history
  4. Fix logger path

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 8, 2024
    Configuration menu
    Copy the full SHA
    ed14d40 View commit details
    Browse the repository at this point in the history
  5. DRY ALLOWED_SCOPES in token serializer

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 8, 2024
    Configuration menu
    Copy the full SHA
    92c88c2 View commit details
    Browse the repository at this point in the history
  6. Use crum's get_current_user()

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 8, 2024
    Configuration menu
    Copy the full SHA
    67036fd View commit details
    Browse the repository at this point in the history
  7. Be specific because people aren't mind-readers

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 8, 2024
    Configuration menu
    Copy the full SHA
    d8b99a2 View commit details
    Browse the repository at this point in the history
  8. Use authenticator name instead of its type

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 8, 2024
    Configuration menu
    Copy the full SHA
    c03cda6 View commit details
    Browse the repository at this point in the history
  9. Just show the None if it's None

    Signed-off-by: Rick Elrod <[email protected]>
    relrod committed May 8, 2024
    Configuration menu
    Copy the full SHA
    077def8 View commit details
    Browse the repository at this point in the history