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

feat: add middleware layer. #1841

Closed
wants to merge 12 commits into from

Commits on Mar 18, 2021

  1. feat: add middleware layer.

    Added a Middleware layer that can be used to alter the results of authentication
    by a connector.
    
    Also added storage support for the new Middleware layer.
    
    Signed-off-by: Alastair Houghton <alastair@alastairs-place.net>
    Issues: dexidp#1635
    al45tair committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    8b5cc73 View commit details
    Browse the repository at this point in the history
  2. feat: add support for custom claims in storage.

    Adds support for custom claims to the storage layer.  This will be used in a
    subsequent commit to allow manipulation of claims from middleware.
    
    Signed-off-by: Alastair Houghton <alastair@alastairs-place.net>
    al45tair committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    f78fcab View commit details
    Browse the repository at this point in the history
  3. feat: add support for custom claims.

    Added support for custom claims, and a simple middleware to allow the
    injection of static claims, which is useful for testing.
    
    Signed-off-by: Alastair Houghton <alastair@alastairs-place.net>
    al45tair committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    16c3bfb View commit details
    Browse the repository at this point in the history
  4. fix: Use Fatalf, not Errorf.

    This should have been a Fatalf() call.
    
    Signed-off-by: Alastair Houghton <alastair@alastairs-place.net>
    al45tair committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    6231771 View commit details
    Browse the repository at this point in the history
  5. feat: add grpc middleware.

    This is a middleware implementation that lets you implement your middleware
    outside of Dex itself, in a separate gRPC server.
    
    Signed-off-by: Alastair Houghton <alastair@alastairs-place.net>
    al45tair committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    88cdfce View commit details
    Browse the repository at this point in the history
  6. fix: Add claims and grpc to the middleware list.

    Claims and grpc weren't in the middleware list in server/middleware.go.
    
    Signed-off-by: Alastair Houghton <alastair@alastairs-place.net>
    al45tair committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    5dbd28e View commit details
    Browse the repository at this point in the history
  7. fix: actually implement inject for claims middleware.

    Apparently I missed off the code for the inject feature in the claims
    middleware.  Also added a test for it.
    
    Signed-off-by: Alastair Houghton <alastair@alastairs-place.net>
    al45tair committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    53f2a28 View commit details
    Browse the repository at this point in the history
  8. fix: the gRPC middleware should preserve connector data.

    There's no reason to pass connector data outside Dex, so we don't send
    it over gRPC.  Unfortunately, we also weren't preserving it, which
    meant that refreshing didn't work if the gRPC middleware was being
    used.  Fix this and add an explicit test for it.
    
    Signed-off-by: Alastair Houghton <alastair@alastairs-place.net>
    al45tair committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    367bc32 View commit details
    Browse the repository at this point in the history
  9. style: fix style-related lint issues.

    Upstream dex has updated golangci-lint with new linters.
    
    Signed-off-by: Alastair Houghton <alastair@alastairs-place.net>
    al45tair committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    c1dd387 View commit details
    Browse the repository at this point in the history
  10. style: fix linter errors.

    The linter was updated.  Fix the things it complained about.
    
    Signed-off-by: Alastair Houghton <alastair@alastairs-place.net>
    al45tair committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    261d230 View commit details
    Browse the repository at this point in the history
  11. fix: fix merge issue.

    ClaimTokHash doesn't exist any more because that isn't how things work now.
    
    Signed-off-by: Alastair Houghton <alastair@alastairs-place.net>
    al45tair committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    9e04fea View commit details
    Browse the repository at this point in the history
  12. fix: fix a couple of missing SQL rows.Close()s.

    The linter is really very good :-)
    
    Signed-off-by: Alastair Houghton <alastair@alastairs-place.net>
    al45tair committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    710763e View commit details
    Browse the repository at this point in the history