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

[Question] Can you provide an example or some words on 'Custom Key Selector from HTTP Context?' #1

Open
jeffward01 opened this issue Oct 13, 2022 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@jeffward01
Copy link
Collaborator

VERY cool project!! Its neat to see something so important and crucial implemented so nicely. This is a fantastic library and will become very popular as soon as more people learn about it.

I had a question about:

context => { /* create custom key selector from HttpContext */ },
response => { /* create a custom response to be sent when a request is revoked */  }

image

  • Can you provide an example of the 'custom key selector'? Im not sure what you mean by this. Do you mean like add the Authorization: Bearer <token> key where Authorization is the key? How would this work?

  • Why would anyone want to provide a custom response, is this an HTTP response? I'm not sure why the library will implement this, when the purpose of the library is to maintain a list of revoked keys. Can you please elaborate?

Thanks!

@rainxh11
Copy link
Owner

  • HttpContextRevokeMiddleware is just an easy built-in middleware that facilitate revoking based on some http request parameters
  • since the HttpContextRevokeMiddleware is to revoke based on request, it is only natural to allow the ability to provide a custom response upon request revoked, it's not 100% well thought out, and it certainly can use some improvements

@jeffward01
Copy link
Collaborator Author

jeffward01 commented Oct 13, 2022

Thanks for this, I will do some testing and examples on my side to better understand this better.

I will either:

  • Create a tiny demo 'sample' that we can push and add as an example, and also add it to the README.md and / or wiki

or

  • Come back to you with questions and then do the above item.

Thanks! We can leave this issue open until the example code is pushed and I have a chance to add more documentation

@jeffward01 jeffward01 self-assigned this Oct 13, 2022
@jeffward01 jeffward01 added the documentation Improvements or additions to documentation label Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants