Comments (17)
Well, I'd say that's a even better reason to make an attempt!
I'll write the steps here, if you want to try it out (and become a contributor), you'll have the opportunity now. These steps are the same for basically all open source projects. I'll be happy to answer any questions you might have! If you don't have time or don't want to, just let me know and I'll do it. 😊
Fork
First off, you need to fork the project. You do this by clicking this button:
You then go into your project, which should now exist under your own profile here.
Clone
Clone this project, either using https
or ssh
. If you haven't set up SSH keys, you chose https
.
Copy this URL, and paste it in your terminal in the folder you'd like it to clone to:
git clone <url>
OR with ssh:
(Cloning projects can also be done through clients or editors, but I can't help you with that)
Install the project dependencies
Now, we have the project installed. If you have poetry, you can just type poetry install
and it'll install the entire environment:
If you don't have poetry, you must install it first. There's the official way here, but if you're on a mac you can also just do a brew install poetry
. pip install poetry
should also work in most cases.
When you've written poetry install
you can write poetry shell
to activate the environment:
Pre-commit
This project uses pre-commit. It's not really documented anywhere, so I'll make sure to do that! How ever, all it requires is that you run pre-commit install
. This will install the pre-commit hooks:
Changing branch and edit the code
Now, all we have to do is create a new branch (from the branch you're on) and edit the code:
git checkout -b fix/typing-error
And then, edit our code in your editor.
Now, we can write git status
to see what files we've made changes to:
We then add this file to commit, by typing git add <filename>
, or git add .
to add them all. When you've added the file, you can create a commit. git commit -m "<commit message>"
is the simplest way:
As you can see, the pre-commit
hooks are now installing.
Making pre-commit hooks pass
With my changes, the pre-commit hook actually changed my file, and my commit did not go through:
Typing git status
I can see that the file is changed from last time I add it:
Since the file was fixed, all I need to do is to add the file and try to commit again:
Success!
Pushing and creating a pull request
Now we push these changes into our branch by typing git push origin <branch name>
:
Then, navigate back to this repository in the web browser and you'll see this button. Click it and create a pull request.
When you create the pull request, tests will automatically run in the branch. 😊
from fastapi-azure-auth.
Hi!
That’s weird. I’ll try to reproduce today or tomorrow.
Could you let me know which version of this library you use?
iss_callable: Optional[Callable[[str], Awaitable[str]]] = None
Seems to be the issue. Reading this SO thread, an upgrade of Python 3.9 could be sufficient.
from fastapi-azure-auth.
A pull request to change from collections to the typing library as suggested is welcome too, if that fixes the problem for you 😊
from fastapi-azure-auth.
Thank you for the quick reply.
Right, I forgot to mention that I'm using the latest version of the library, 3.2.0.
I've tried to upgrade from Python 3.9.1 to 3.10.0, but that did not make any difference. Python 3.9.2 is not available for me due to company policies.
Then I changed from collections to typing and now the code compiles and I can authenticate successfully. Thanks for the suggestion.
from fastapi-azure-auth.
Perfect! Would you like to submit a PR to fix it here as well? 😊
from fastapi-azure-auth.
Bare in mind I'm a total noob here :) So not sure how to do that properly.
from fastapi-azure-auth.
Thanks for the detailed guide, I'd definitely would like to give it a try, but won't have time today. I'd get back to it tomorrow or the day after, as time allows. Hope that works.
from fastapi-azure-auth.
No rush at all! Let me know if you have any questions or bump into any issues. 😄
EDIT: I've now added a CONTRIBUTING.md file, which sums the comment up in a few steps.
from fastapi-azure-auth.
Hi Jonas,
I've tried to contribute by following your guide, but ran into some issues with poetry. My company uses a proxy repo and one of the requirements of poetry is blocked, so I can't install it. Unfortunately I don1t have permissions to view the detailed report, so I don't know why is it blocked exactly, but apparently for now this is a no-go, on my company machine at least.
So I figured I'll try from my private PC, but that had nothing development related set up and got to the point where I've installed poetry with pip install
. But then for pre-commit install
I don't get any output. No error either, seemingly nothing happens:
So not sure what's going on, but didn't want to proceed. Any ideas on that?
And another note regarding Python 3.10.0. I've made a rookie mistake and did not create venvs, and did not realize that after installing 3.10.0 my code was still running on 3.9.1. So it's actually possible that upgrading too would solve the issue. Unfortunately I can't verify as on 3.10.0 I can't install the dotenv package, due to above mentioned proxy repo blocking this as well, so I can't compile the code without rewriting it with an alternative to dotenv. Or finding the right team and getting dotenv unblocked. Neither of them would be quick.
from fastapi-azure-auth.
I've tried to contribute by following your guide, but ran into some issues with poetry. My company uses a proxy repo and one of the requirements of poetry is blocked, so I can't install it. Unfortunately I don1t have permissions to view the detailed report, so I don't know why is it blocked exactly, but apparently for now this is a no-go, on my company machine at least.
Ah, dang.
So I figured I'll try from my private PC, but that had nothing development related set up and got to the point where I've installed poetry with pip install. But then for pre-commit install I don't get any output. No error either, seemingly nothing happens:
Hmm, what happens if you run pre-commit run --all-files
?
And another note regarding Python 3.10.0. I've made a rookie mistake and did not create venvs, and did not realize that after installing 3.10.0 my code was still running on 3.9.1. So it's actually possible that upgrading too would solve the issue. Unfortunately I can't verify as on 3.10.0 I can't install the dotenv package, due to above mentioned proxy repo blocking this as well, so I can't compile the code without rewriting it with an alternative to dotenv. Or finding the right team and getting dotenv unblocked. Neither of them would be quick.
Sounds pretty rough to develop at your work environment, not gonna lie. 😁
from fastapi-azure-auth.
I've tried to contribute by following your guide, but ran into some issues with poetry. My company uses a proxy repo and one of the requirements of poetry is blocked, so I can't install it. Unfortunately I don1t have permissions to view the detailed report, so I don't know why is it blocked exactly, but apparently for now this is a no-go, on my company machine at least.
Ah, dang.
So I figured I'll try from my private PC, but that had nothing development related set up and got to the point where I've installed poetry with pip install. But then for pre-commit install I don't get any output. No error either, seemingly nothing happens:
Hmm, what happens if you run
pre-commit run --all-files
?
Same, no output at all :/
And another note regarding Python 3.10.0. I've made a rookie mistake and did not create venvs, and did not realize that after installing 3.10.0 my code was still running on 3.9.1. So it's actually possible that upgrading too would solve the issue. Unfortunately I can't verify as on 3.10.0 I can't install the dotenv package, due to above mentioned proxy repo blocking this as well, so I can't compile the code without rewriting it with an alternative to dotenv. Or finding the right team and getting dotenv unblocked. Neither of them would be quick.
Sounds pretty rough to develop at your work environment, not gonna lie. 😁
Yeah, especially if one's not a developer, like myself :) Also, it's a fairly new tool, Both the tool and the processes around it are still tweaked, which also does not help much.
from fastapi-azure-auth.
Hmm, that’s weird.
I’m not sure what’s wrong honestly. If you have poetry and then write poetry install
, then poetry shell
you should be in the environment, with pre-commit installed.
from fastapi-azure-auth.
Yeah, weird. poetry install
completed successfully, the venv shown by poetry shell
looks a bit different than your's, but I think that's because I'm on Windows. Yet still nothing for pre-commit install
:
Btw, it was surprisingly easy to find someone with a way around the blocked dotenv package, so I was able to test Python 3.10.0 and with that it works even if I revert to collections.abc
.
from fastapi-azure-auth.
Yeah, I honestly don’t know what’s wrong 🤔
If you’d like to fix the bug and then submit a PR, it’s not the end of the world with linting. I can fix that in your PR 😄
from fastapi-azure-auth.
Unfortunately I could not figure out what's wrong with poetry, but I've created a new PR.
from fastapi-azure-auth.
Thank you! 😄 I'll fix whatever needs fixing and push a new version to PyPi ASAP.
from fastapi-azure-auth.
@ravaszf , I've pushed a change to PyPi.
Thank you for your bug report and contribution! Let me know if there's anything more I can help you with.
EDIT: You've also been tagged as a contributor if you look at the release here. We also appreciate a ⭐ on the project if you haven't done so 😊
from fastapi-azure-auth.
Related Issues (20)
- [Feature request] support Pydantic v2 syntax / @validator -> @field_validator HOT 5
- [BUG/Question] Fixing TypeError during WebSocket Authentication Migration from FastAPI 0.96 to 0.97 HOT 8
- Calling your APIs from Python not working HOT 22
- [Question] Middleware logging does not get request.state.user HOT 2
- Make leeway a setting available for configuration
- [Question] HOT 6
- [BUG/Question] auth_time is parsed as a string, should be int HOT 2
- [BUG/Question] Got 'Token contains invalid claims' error for the `single tenant setup example ` HOT 6
- [Question] Validate bearer token from Angular SPA (Azure AD) in FastAPI HOT 4
- [BUG/Question] Error calling openid_config.load_config with Httpx 0.25.1 HOT 4
- [Bug/Question] HOT 2
- Adding new fields for Client Secret JWT HOT 1
- [Question] Graph API call triggers "admin consent required" HOT 1
- SOLVED: CVE-2024-23342 `ecdsa` may be vulnerable to the Minerva attack HOT 3
- Facing authentication issue mentioning pkce required for cross-origin authorization code redemption HOT 1
- [BUG] got claim `acct` in type `int`, but fastapi-azure-auth is waiting for `str` HOT 1
- Add ability to specify audience and issuer to validate token claims against HOT 1
- [BUG/Question] Example use cases for scopes HOT 6
- [Feature request] Support WebSocket connections. HOT 3
- Empty raise HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastapi-azure-auth.