-
Notifications
You must be signed in to change notification settings - Fork 815
Add extension points for custom token generators (#732) #749
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
Conversation
Pull Request Test Coverage Report for Build 1212
💛 - Coveralls |
# expires_in is passed to Server on initialization | ||
# custom server class can have logic to override this | ||
expires = timezone.now() + timedelta(seconds=token.get( | ||
'expires_in', oauth2_settings.ACCESS_TOKEN_EXPIRE_SECONDS, |
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.
Looks unrelated
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.
Totally related, this changeset is about the way to configure Server instance and since we have the settings variable already it makes total sense to pass it there too now that a way to pass variables is added.
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.
Also, it's required for a token generator (that can be unaware of DOT and its settings) to have access to this value -- it's normally passed as a request attribute (or its result when it's a callable).
98ab6cc
to
9e16d82
Compare
9218d7c
to
08ac02e
Compare
@IvanAnishchuk is a migration file really needed for tests only models? |
0459550
to
23e06e9
Compare
Pass variables generated based on settings when initializing Server. Add a property to settings class for convenience. Update settings documentation to reflect additions.
Enable multi-env building. Update environments used.
23e06e9
to
99d12b4
Compare
I fixed the tests, not sure whether it should be a separate PR. |
Yes, if we want tests to work on some of the versions and don't want to disable all migrations in tests. Otherwise everything just fails with setup error (caused by non-migrated models depending on migrated models as far as I could figure it out) but feel free to suggest alternative fixes if you find any, I don't like this either. |
which versions specifically? |
Django 3.0 there's also a similar error with django 2.2 on python 3.4 but that seems to be a separate problem. |
tox.ini
Outdated
django20: Django>=2.0,<2.1 | ||
django21: Django>=2.1,<2.2 | ||
django22: Django>=2.2,<3 | ||
django30: Django>=3.0a,<3.1 |
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.
3.0b1
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.
It's >=
so it'll be whatever the latest version is.
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.
then 3.0a1 as it's on pypi
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.
It's not gonna change what's installed but sure, changed.
Use fully-qualified 3.0a1 version specifier instead of 3.0a.
Hi all, I'm trying out this PR to add JWT access' token. |
@IvanAnishchuk I will find some time this week to test properly the tox matrix, the migration still doesn't look too right to me so I'd like to investigate this a bit, other than that 👍 |
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.
@IvanAnishchuk It's after-the-fact (already merged back in October) but I'm now discovering where you disabled several of the tox tests. The more appropriate solution would be to fix the code that causes the tests to fail.
Pass variables generated based on settings when initializing Server.