Saravanan666/pypi-org huggingface dataset:
Package: jwtberry
jwtberryjwtberryis a Python package that simplifies JWT (JSON Web Token) authentication for Django Strawberry GraphQL projects. It provides easy-to-use tools for implementing JWT authentication within your Strawberry-based GraphQL API.FeaturesSeamless integration with Django Strawberry GraphQL.Simplified JWT authentication setup for your API.Customizable token generation and validation.InstallationYou can installjwtberryusingpip:pipinstalljwtberryUsageAdd 'jwtberry.blackberry' app to your Django INSTALLED_APPS in the settings.py file:INSTALLED_APPS=[# ...'jwtberry.blackberry',]Configure your Django project's AUTHENTICATION_BACKENDS in settings.py to include the JwtAuthBackend from jwtberry:AUTHENTICATION_BACKENDS=["jwtberry.backends.JwtAuthBackend","django.contrib.auth.backends.ModelBackend",]Update your project's urls.py by importing JwtAsyncGraphQLView from jwtberry.views and adding a path for the GraphQL endpoint:fromjwtberry.viewsimportJwtAsyncGraphQLViewurlpatterns=[# ...path("graphql/",JwtAsyncGraphQLView.as_view(schema=schema)),]In your schema.py (where you define your GraphQL schema), make the following changes to include JWT-based authentication:importstrawberryfromjwtberry.mutationsimportauth_tokenfromjwtberry.permissionimportIsAuthenticatedfromjwtberry.typesimportJwtAuthResponse@strawberry.typeclassQuery:hi:str=strawberry.field(resolver=lambda:"Hello",permission_classes=[IsAuthenticated])@strawberry.typeclassMutation:login:JwtAuthResponse=auth_tokenschema=strawberry.Schema(query=Query,mutation=Mutation,)IsAuthenticatedis a permission class that checks whether the user has authenticated by verifying the Authorization header.For more detailed information and examples, check theexampleproject.
Package: jwt-django
jwt_djangodiscontinuejwt_django discontinue for some reasonsinclude all the feature merge the webraft libararyhttps://github.com/MominIqbal-1234/webraftwith new updatepypi :https://pypi.org/project/webraft/doc :https://webraft.mefiz.comCheck Our Site :https://mefiz.comDeveloped by : Momin Iqbal
Package: jwtdown-fastapi
JWTdown for FastAPIThis is an easy-to-use authentication mechanism for FastAPI.It draws inspiration from the tutorials found in the FastAPI
documentation.Please read thedocumentationto use this project.DevelopingDevelopment on this project is limited to employees, contractors, and students
of Galvanize, Inc.When a new version of FastAPI is released:Review theMINIMUM_VERSIONinupdate_fastapi_versions.pyand bump it
as necessaryRun theupdate_fastapi_versions.pyRunpoetry updateAdd and commit the changes to:pyproject.toml.tox-ci.ymlpoetry.lockIf all three of those things didn't change, check what you're doing.
Package: jwt-eddsa-base44
JWT EdDSA Base44The token is a base44 encoded string separated by spaces.
As it uses base 44, the token can be used in an alphanumeric QR Code. The technique allows more data to be stored in a QR code.CaracteristicsEdwards-curve Digital Signature Algorithm (EdDSA) using Ed25519 curveBase44 encodingExample of tokenICGTHFI$E8U7MN44OB$M4/A4$*C2SD8U7HN4GBDH0B$M4/A4%SF24F8U7.M4TO4 9HFWBF VQC1H7X4MVEM*2I6LPQBKGKITVMNOMAB5K78+IVLHCWNJ8-W*LIQXA%B9PSLA:PU-5*W83F0H-0*B10A7DEDGVLPC5*:WT/3
Package: jwt-email-auth
JSON Web Token Email Authenticationpipinstalljwt-email-authDocumentation:https://mrthearman.github.io/jwt-email-auth/Source Code:https://github.com/MrThearMan/jwt-email-auth/This module enables JSON Web Token Authentication in Django Rest framework without using Django's User model.
Instead, login information is stored incache, a login code is sent to the user's email inbox,
and then the cached information is obtained using the code that was sent to the given email.
Package: jw-test
## python ##### 常用命令 ###python -m -pip install XX使用pip的时候在后面加上-i参数，指定pip的下载源pip install numpy -ihttps://pypi.tuna.tsinghua.edu.cn/simple上面命令每次运行需要指定网址，可进行永久修改：windows下: 在user目录中创建一个pip目录，如：C:Users（用户）xxpip，新建文件pip.ini，内容如下[global]
index-url =https://pypi.tuna.tsinghua.edu.cn/simplelinux下: 修改 ~/.pip/pip.conf （如果没有自己创建一个）， 内容如下：[global]
index-url =https://pypi.tuna.tsinghua.edu.cn/simple参考：https://blog.csdn.net/yamadeee/article/details/80178996## 安装模块 ##python setup.py build
python setup.py sdistpython -m pip install twine
$https://pypi.org/manage/projects/可以配置到$HOME/.pypirc文件中，就不用多次输入了[pypi]
username = <username>
password = <password>再使用twine发布到服务器：twine upload dist/*
Package: jwt-flask-ext
JWT Flask AuthenticationThis package provide an easy way to handle authentication
in a flask application. By now it manages login and token required
constraint.How to useYou must have a user class defined like this:fromflask_sqlalchemyimportSQLAlchemyfromwerkzeug.securityimportcheck_password_hashdb=SQLAlchemy()classUser(db.Model):...id=db.Column(db.Integer,primary_key=True)username=db.Column(db.String(255))password=db.Column(db.String(255))...defvalidate_password(self,password):returncheck_password_hash(self.password,password)...Then instanciate the Auth class and decorate view functions:fromjwt_flask_authimportAuthfromflaskimportFlaskfrommodelsimportUserapp=Flask(__name__)auth=Auth(user_class=User,user_id_field='id',username_field='username',password_field='password',)@app.route('/login',methods=['POST'])deflogin():returnauth.login()@app.route('/protected')@auth.token_requireddefprotected_route():return'You have access'Login will generate a token with a payload containing the user_id, username, and the expiration.
Package: jwt-generator
A simple command line jwt token generator based on a rsa private key.By default it will print a JWT token with iss, nbf and exp set which is signed
by the private key in ~/.ssh/id_rsa.:iss - will be set to the current user name
nbf - will be set to 1 minute in the past
exp - will be set to 30 minutes in the future.You can override the default settings on the command line.Options--issuerTEXTof the token--not-beforeINTEGERnumber of seconds before now the token is no longer valid--expires-afterINTEGERnumber of seconds after which the token is no longer valid--private-key-filePATHthe private key file to sign the token with-A,--authorization-headerprint authorization header bearer token--helpShow this message and exit.ExampleTo send the the authorization bearer token with curl, type:curl -H "$(jwt-generator -A)" https://httpbin.org/headersInstall on MacOSTo install you MacOs you might run into trouble due to the dependency on cryptography. Type::export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"before you do thepip install jwt-generator. Seehttps://github.com/pyca/cryptography/issues/2692for details.
Package: jwtjwkhelper
JWTJWKHelperhttps://github.com/vroomfondel/jwtjwkhelperThis package is a simple Helper to work with JWT also using RSA-signatures and different keys.
May or may it not be helpfull for you. But since I already used this more than three times, it just made it
easier for me to wrap it in a package for PyPI.Examples...jwtjwkhelper
Package: jwt-kms
Pythonjwt_kmslibraryThis library is work in progress.Isolating private asymmetric keys to AWS KMS helps improve security by
making it next to impossible to make copies of them. This library aims to
provide a simple interface to use KMS keys to sign payloads into JWS tokens
and/or to encrypt payloads into JWE tokens.Signing with RSA and EC keys is currently supported.Keysimport boto3
from jwt_kms import jwk

client = boto3.client('kms')
key = jwk.JWK(client, 'some-key-id')

public_key_pem = key.public_key_pemSigningfrom jwt_kms import jws

payload = {
   'something': 'yes',
   'more_something': 'abc'
}

token = jws.JWS(payload).add_signature(key, 'RS256').serialize(compact=True)  # or compact=FalseEncryptingTODO.
Package: jwtlib
Initialize local repository$poetryinstall$poetryshell# Open shell within the virtualenvAvailable commands$peltak--help# Show the list of available commands$peltaktest# Run tests$peltakcheck# Run code checks$peltakdocs# Build documentation using SphinxRelease new versionWhile on master branch, you can release the current state of it by runningpeltakreleasecreate# Create a patch releasepeltakreleasecreate-tpatch# Create a patch releasepeltakreleasecreate-tminor# Create a minor releasepeltakreleasecreate-tmajor# Create a major release
Package: jwtools
jwtools集微工具箱，包括各种常用操作，后续不断完善构建在项目文件夹中运行以下命令pythonsetup.pysdistbdist_wheel上传：python-mtwineupload--repository-urlhttps://upload.pypi.org/legacy/dist/*
或
python-mtwineuploaddist/*按照提示，输入pypi的用户名、密码，就可以成功了。若中途提示有些库没有安装，则使用pip安装一下，需要用到twine库。使用安装或更新pip3 install jwtools
pip3 install --upgrade jwtools代码使用fromjwtools.funcimport*fromjwtools.io_utilimport*mm5=get_text_md5("dddd")print(mm5)# write_text_to_fileresult=write_text_to_file("D:/test/test123.txt",mm5)print(result)# read_text_from_filecc=read_text_from_file("D:/test/test123.txt")print(cc)
Package: jwtpie
JWT easy as pie.jwtpie is a highly opinionated library that makes encrypting and decrypting
JWT tokes super easy. Perfect addition to your API backends.jwtpie does the following:Serialize and possibly compress your data.Generate a signed JWT token with your serialized data.Generate an encrypted JWT token with your signed JWT token.And also:Decrypt your encrypted JWT token, and validate it is still valid.Verify signature of decrypted JWT token and validate it is still valid.De-serialize and possibly decompress your data.Installpip3installjwtpieOptionally, install eitherorjson(preferred) orujson(good) for a faster
JSON decoding:pip3installorjsonOr …pip3installujsonUsage>>>fromjwtpieimportJWTPie>>>mgr=JWTPie()>>>token=mgr.encrypt({...'user':'jane_doe@anonymous.io',...'name':'Jane Doe',})>>>token'eyJhbGciO[.........]iJBMjU2S1ldbM'>>>mgr.decrypt(token){'user':'jane_doe@anonymous.io','name':'Jane Doe',}So easy.The above will generate a new signing and encryption key on-the-fly. If the
process is restarted or killed, the key will be lost and all tokens generated
with it will no longer be decryptable.To allow to decode previously generated tokens pass the signing and encryption
key in the constructor:>>>mgr=JWTPie(...issuer='myapp',...signkey='YOUR PRIVATE SIGNING KEY',...encryptkey='YOUR PRIVATE ENCRYPTION KEY',...expiration_s=1209600,# In seconds. 60 * 60 * 24 * 14 = Two weeks...)To generate a private key execute:>>>fromjwtpieimportJWTPie>>>size=256>>>JWTPie.generate(size)noOIbGe_WLbTfrLIH_grNu0bf5u8Xx-bERELm2TLRaMOr launch the interactive wizard:$ python3 -m jwtpie

1. Craft a session.
2. Generate a new encryption or signing key.

What do you need? 2
Size: 256

Your key:

R5Co9mHaxURSzhryvvx8JqgpFLinhvd6L3rb2TxRx7o

Bye!KEYS ARE SECRET!Save it in your secret management system!Do not hard code it.Do not commit it to version control.Never log it.jwtpie is opinionated because it selects the signing and encryption algorithms
for you. If you need to change this or change advanced parameters like the
leeway please read the documentation in the docstring of the JWTPie class.Repositoryhttps://github.com/kuralabs/jwtpieAcknowledgementsJWTPie is just an easy to use abstraction layer built on top of the greatJWCryptolibrary. JWCrypto does the actual work of creating and verifying the
tokens according to the JWT specification. JWCrypto is itself built on top of
the securecryptographylibrary.Changelog1.1.0 (2021-06-08)NewNew methoddecrypt_with_metadata()that will return the encrypted data
along with the standard JWT claims.1.0.0 (2021-06-01)NewInitial release.LicenseCopyright (C) 2016-2021 KuraLabs S.R.L

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
Package: jwt-pydantic
jwt-pydanticJWT claim sets are becoming more complex and harder to manage. Writing validators for these claims checks is time consuming.This package uses the power of Pydantic models, to make life a bit easier.We have also included a Starlette middleware, which can be easily used in FastAPI, as shownhere.ExampleLet's say our JWT token has the claims set below:claims={"firstname":"David","surname":"Bowie","best_album":"Hunky Dory"}We can usejwt-pydanticto simplify the generation and verification of such tokens. First we declare the Pydantic model, by subclassingJWTPydantic:fromjwt_pydanticimportJWTPydanticclassMyJWT(JWTPydantic):firstname:strsurname:strbest_album:strTo generate a new JWT token, using the claims above, we do the following:token=MyJWT.new_token(claims=claims,key="SECRET_KEY")We can then verify this token easily as followsMyJWT.verify_token(token,key="SECRET_KEY")We can also return the decoded JWT token as our Pydantic model, to be used elsewhere:decoded_jwt=MyJWT(token,key="SECRET_KEY")print(decoded_jwt.firstname)# DavidFastAPI MiddlewareIt is also easy to declare a new JWTPydantic model and use this in middleware, as shown below.# main.pyfromfastapiimportFastAPIfromjwt_pydanticimportJWTPydantic,JWTPydanticMiddlewareSECRET_KEY="mykey"classMyJWT(JWTPydantic):foo:intapp=FastAPI()app.add_middleware(JWTPydanticMiddleware,header_name="jwt",jwt_pydantic_model=MyJWT,jwt_key=SECRET_KEY,)@app.get("/")defhomepage():return"Hello world"We can run this code easily using uvicorn (uvicorn main:app --reload), and then using python on a different shell, we can test this to show it in action:importrequestsrequests.get('http://127.0.0.1:8000/',headers={'jwt':MyJWT.new_token({'foo':1},'mykey')})# b'Hello World'If we want to change the response when the JWT token is bad, you can override the method inbad_responseinJWTPydanticMiddleware, such as below:classMyMiddleware(JWTPydanticMiddleware):defbad_response(self,token_error:str)->JSONResponse:"""Changing standard response to be a JSONResponse"""returnJSONResponse({"bad_token":token_error},status_code=403)python-jose keyword argumentsJWTPydanticusespython-joseto manage the JWT tokens. The extra features that are provided using this package can be easily used through the keyword argumentjose_opts. For instance, we can add the 'at_hash' claim to our JWT token by specifying the keyword argumentaccess_token.MyJWT.new_token(claims,SECRET_KEY,jose_opts={"access_token":"1234"},)
Package: jwtserver
JWT serverJWTServer лёгкий и быстрый микросервис JWT.JWT Server является микросервисом для авторизации пользователей. Имеющий гибкие настройки и разные версии API.Подключение Google Recaptcha V3Отправка кода через сервисhttps://smsc.ru/(стадия тестирования)ОсобенностиБыстрый стартПоходит для тестирования frontendОснован на Fast API framework и вдохновлен работамиtiangoloRoute EntrypointsLogin[POST]- /api/v1/login/access-token[POST]- /api/v1/login/test-token[POST]- /api/v1/password-recovery/{email}[POST]- /api/v1/reset-password/[POST]- /api/v1/phone_status/Users[GET]- /api/v1/users/[POST]- /api/v1/users/[GET]- /api/v1/users/me[PUT]- /api/v1/users/me[POST]- /api/v1/users/open[GET]- /api/v1/users/{user_id}[PUT]- /api/v1/users/{user_id}Utils[POST]- /api/v1/utils/test-celery/[POST]- /api/v1/utils/test-email/Items[GET]- /api/v1/items/[POST]- /api/v1/items/[GET]- /api/v1/items/{id}[PUT]- /api/v1/items/{id}[DELETE]- /api/v1/items/{id}Поддержка кодаhttps://github.com/goltsevnet/jwtserverЗависимостиuvicornhttps://www.uvicorn.org/fastapihttps://fastapi.tiangolo.com/starlettehttps://www.starlette.io/passlibhttps://pypi.org/project/passlib/pydantichttps://pydantic-docs.helpmanual.io/redishttps://pypi.org/project/redis/python-josehttps://pypi.org/project/python-jose/sqlalchemyhttps://pypi.org/project/SQLAlchemy/sqlalchemy_utilshttps://sqlalchemy-utils.readthedocs.io/asyncpghttps://pypi.org/project/asyncpg/psycopg2-binaryhttps://pypi.org/project/psycopg2-binary/httpxhttps://www.python-httpx.org/python-dotenvhttps://pypi.org/project/python-dotenv/Установкаpython-mpipinstalljwtserverПодготовьте базу данныхPostgres 14и выше версии.Используйте как вариантdocker-compose.yamlversion:'3.1'services:db:image:postgres:14.1-alpinerestart:alwaysbuild:.environment:POSTGRES_PASSWORD:exampleports:-5433:5432Обязательно добавьте переменную в среду:POSTGRES__DSNдля миграций.Выполните команду:upgradeheadДолжны увидеть:INFO[alembic.runtime.migration]ContextimplPostgresqlImpl.
INFO[alembic.runtime.migration]WillassumetransactionalDDL.
INFO[alembic.runtime.migration]Runningupgrade->98f3d19d2c0d,initialОстальные переменные можно добавить в файл.envили через dotenv.ENVIRONMENT=production
PROJECT_NAME=JwtServer

SMS__LOGIN=login
SMS__PASSWORD=password
SMS__IGNORE_ATTEMPTS=True

POSTGRES__DSN=postgresql+psycopg2://postgres:example@localhost:5433/postgres

RECAPTCHA=True

GOOGLE__RECAPTCHA__SECRET_KEY=SECRET_KEY
TOKEN__V1_SOL=12345679100987654321
TOKEN__SECRET_KEY=SECRET_KEY
TOKEN__ACCESS_TOKEN_EXPIRE_MINUTES=90
API_V1_STR=/api/v1Примеры:Для разработкисоздайте файлdev.pyfromjwtserver.serverimportdevif__name__=="__main__":dev(host="localhost",port=5000,log_level="info")Интерактивная API документацияоткройтеInteractive API docshttp://localhost:5000/docsВы увидите автоматическую интерактивную документацию по API.Альтернативная API документацияоткройтеAlternative  API redochttp://localhost:5000/redocДля продукциисоздайте файлmain.pyfromjwtserver.appimportappapp.debug=FalseGunicorn:gunicorn main:appЛицензияЭтот проект находится под лицензией Apache 2.0.
Package: jwtsign
JWTSignRust jwt signing bindings for pythonUsage:importtimeimportjsonfromjwtsignimportPyJwtEncoder,PyJwtDecoderdefread_bin(path:str)->bytes:withopen(path,"rb")asfile:returnfile.read()claims={"id":"example","exp":int(time.time()+60),}private_key=read_bin("res/private_key.pem")public_key=read_bin("res/public_key.pem")encoder=PyJwtEncoder(private_key)decoder=PyJwtDecoder(public_key,leeway=60)# Using object encodingtoken_claims_obj=encoder.encode_claims_json_obj(claims)decoded_claims_obj=decoder.decode(token_claims_obj)# Using serialized object encodingtoken_claims_str=encoder.encode_claims_json_str(json.dumps(claims))decoded_claims_str=decoder.decode(token_claims_str)Decoder validates expiration time based on UTC with a leeway defined in thePyJwtDecoder::__init__.[!NOTE]
If at any point you have your claim as serialized JSON keep in mind that this performs slightly faster than the object as encoding parameter, as the rust code uses python bindings to calljson.dumpson the object.
Package: jwt-signature-validator
JWT Signature ValidatorJWT Signature Middleware is a pure ASGI Middleware that can be used with AGSI frameworks like FastAPI, Starlette and Sanic.Installationpipinstalljwt-signature-validatorUsagefromfastapiimportFastAPIfromjwt_signature_validatorimportEncodedPayloadSignatureMiddlewarefrompydanticimportBaseModelapp=FastAPI()app.add_middleware(EncodedPayloadSignatureMiddleware,jwt_secret="hello",jwt_algorithms=["HS256"],protect_hosts=["*"])classModel(BaseModel):text:str@app.post("/")defcheck(req:Model):returnreqLicenseThis project is licensed under the terms of the MIT license.
Package: jwt-token-parser
JWT Token ParserA small library to parse jwt tokenInstallationpip install jwt-token-parserGet startedHow to get payload from jwt token:fromjwt_token_parserimportJWTTokenParser# Instantiate a Multiplication objectjwt_parser=JWTTokenParser()# Call the multiply methodresult=jwt_parser.get_payload_by_access_token(key='SECRET_KEY')
Package: jwt-token-parser-test
JWT Token ParserA small library to parse jwt tokenInstallationpip install jwt-token-parser-testGet startedHow to get payload from jwt token:fromjwt_token_parser_testimportJWTTokenParser# Instantiate a Multiplication objectjwt_parser=JWTTokenParser(key='SECRET_KEY')# Call the multiply methodresult=jwt_parser.get_payload_by_access_token()
Package: jwt-token-parser-test-1
JWT Token ParserA small library to parse jwt tokenInstallationpip install jwt-token-parser-testGet startedHow to get payload from jwt token:fromjwt_token_parser_test_1importJWTTokenParser# Instantiate a Multiplication objectjwt_parser=JWTTokenParser(key='SECRET_KEY')# Call the multiply methodresult=jwt_parser.get_payload_by_access_token()
Package: jwt-user
jwt_userA Python implementation of acquiring, authorizing user from jwt token.
designed to work for any request entity from flask,django,tornado frameworks.InstallingInstall withpip:$ pip install jwt_userUsage>>> import jwt_user
>>> payload = {'username': 'test'}
>>> token = jwt_user.generate_token(payload)
>>> request = jwt_user.generate_request(token)
>>> user = jwt_user.get_jwt_user(request)
>>> user
{}
>>> user.username
'test'
>>> #Second usage
... 
>>> import tornado
>>> BaseRequestHandler = tornado.web.RequestHandler
>>> class MainHandler(BaseRequestHandler):
...     @jwt_user.authorized_user
...     def get(self):
...         self.write('Hello, Authorized user')
...
>>> class MainUserHandler(BaseRequestHandler):
...     @jwt_user.authorized_user
...     def get(self):
...         user = jwt_user.get_jwt_user(self.request)
...         self.write('Hello, {}'.format(user.username))
>>>
>>> os.environ['JWT_EXPIRATION_DELTA'] = '3400'
>>> os.environ['JWT_PRIVATE_KEY'] = 'some random hexa private text'
>>> os.environ['JWT_SECRET_KEY'] = 'some random hexa secret text'
>>> os.environ['JWT_AUTH_HEADER'] = 'Authorization'
>>> os.environ['JWT_AUTH_HEADER_PREFIX'] = 'Bearer'
>>> def make_app():
...     user_valid_fields = {'username', 'user_id', 'token'}
...     jwt_user.set_user_valid_fields(user_valid_fields)
...     application = tornado.web.Application([
...     (r'/', MainHandler),
...     (r'/user_page', MainUserHandler)])
...     return application
>>>],DocumentationView the full docs online athttps://jwt_user.readthedocs.io/en/latest/TestsYou can run tests from the project root after cloning with:$ make smoke