
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
django-oauth-usp
Advanced tools
Este pacote permite que usuários façam login utilizando a senha única USP.
Além da autenticação OAuth este pacote também possui migrations para o armazenamento dos usuários no banco de dados.
É recomendado que a estas migrations sejam rodadas antes de qualquer outra migration, devido a dificuldade de alteração do model User depois de realizada a primeira migration:
Using a custom user model when starting a project
Adicione "django_oauth_usp" em INSTALLED_APPS no arquivo settings.py
INSTALLED_APPS = [
...
'django_oauth_usp.accounts',
]
Adicone o Middleware OAuthUspMiddleware
MIDDLEWARE = [
...
'django_oauth_usp.accounts.middleware.OAuthUspMiddleware',
]
No arquivo settings.py, informe o Model que será utilizado para armazenar os usuários
```
AUTH_USER_MODEL= 'accounts.UserModel'
```
Defina os parâmetro para OAuth::
OAUTH_CALLBACK_ID = 'callback_id_da_aplicação'
AUTHLIB_OAUTH_CLIENTS = {
'usp': {
'client_id': 'meu_client_id',
'client_secret': 'meu_secret_key'
}
}
#Rota utilizada para a view accounts_authorize
REDIRECT_URI = '/auth/authorize'
#Lista com o código das unidades que poderão ter acesso.
ALLOWED_UNIDADES = [12, 13, 14]
Rode as migrations::
python manage.py migrate
Adicione rotas para as views accounts_login e accounts_authorize::
urlpatterns = [
path('login', accounts_login, name='login'),
path('authorize', accounts_authorize, name='authorize'),
]
Os model UserModel provê os seguintes dados do usuário
user.get_full_name()
user.get_short_name()
user.email_user()
user.get_phone()
user.is_servidor()
user.get_funcao()
user.get_vinculo()
user.get_setor()
FAQs
Unknown package
We found that django-oauth-usp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.