-
Notifications
You must be signed in to change notification settings - Fork 197
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
Admission check endpoint #338
Conversation
const pubkey = request.params.pubkey | ||
const user = await this.userRepository.findByPubkey(pubkey) | ||
|
||
console.log('user', user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove
} | ||
|
||
public async isRateLimited(request: Request, settings: Settings) { | ||
const rateLimits = path(['limits', 'invoice', 'rateLimits'], settings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have a different rate limit for this endpoint
Head branch was pushed to by a user without write access
I'm sorry, I missed a crucial commit... I think this structure makes more sense. Another commit is coming with an addressed rate limits comment. |
@medjedovicm ive fixed the integration tests, do you mind rebasing off the main branch to incorporate the fix into yours? |
@cameri Yes sure, done. |
Pull Request Test Coverage Report for Build 7506254600
💛 - Coveralls |
🎉 This PR is included in version 2.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
Created
admission router
andadmission check controller
which runs a check against the providedpubkey
in the URL parameter and returns JSON with information if the user (pubkey) is admitted or not.GET
/admissions/check/:pubkey
Response:
Related Issue
Closes #336
Motivation and Context
In our use case, we need to check if a user is admitted on our own relay before we let them log in.
The user is redirected to the relay page (in the new tab) while we send a check request every 10 seconds or so, so we can automatically figure out when payment is done.
How Has This Been Tested?
Visited a new endpoint in the browser, looking for the response.
As far as I am aware my changes do not affect any other parts of the code.
Screenshots (if appropriate):
Types of changes
Checklist: