Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A Django app that handles the communication between the IDP and the products for the authorization of users.
Install the package:
pip install django-idp-user
If you want to use the async version of the package, you can install it with the async
extra:
pip install django-idp-user[async]
Add idp_user
to your INSTALLED_APPS
:
INSTALLED_APPS = [
# ...
'idp_user',
]
Add the settings of the app in settings.py
like this:
AUTH_USER_MODEL = 'idp_user.User'
IDP_USER_APP = {
"IDP_ENVIRONMENT": "staging/production/etc.",
"APP_IDENTIFIER": "str",
"ROLES": "path.to.roles_choices",
"FAUST_APP_PATH": "backend.kafka_consumer.app",
"USE_REDIS_CACHE": True,
"IDP_URL": "idp_url", # Optional
"APP_ENTITIES": {
"<entity_type>": {
"model": "<path.to.entity_type.model>",
"identifier_attr": "<field_name>",
"label_attr": "<field_name>",
}
},
}
REST_FRAMEWORK = {
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema' or 'idp_user.schema_extensions.AutoSchemaWithRole',
'DEFAULT_AUTHENTICATION_CLASSES': (
'idp_user.auth.AuthenticationBackend',
),
}
SPECTACULAR_SETTINGS = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'idp_user.schema_extensions.BearerTokenScheme',
),
'SERVE_AUTHENTICATION': ()
}
# Kafka Related
KAFKA_ARN = "<aws_kafka_arn>" # Encoded in base64
KAFKA_AWS_ACCESS_KEY_ID = "<access_key_id>"
KAFKA_AWS_SECRET_ACCESS_KEY = "<secret_access_key_id>" # Encoded in base64
AWS_S3_REGION_NAME = "<region_name>"
Create the database tables for the app by running the following command:
python manage.py migrate
Django version 4.1.1 is required for async support.
To use the async version of the package, you need to add the async
extra when installing the package:
pip install django-idp-user[async]
If you are using Channels for websockets, you can use the IDPChannelsAuthenticationMiddleware
like so:
from channels.routing import ProtocolTypeRouter, URLRouter
from idp_user.auth import IDPChannelsAuthenticationMiddleware
application = ProtocolTypeRouter({
"websocket": IDPChannelsAuthenticationMiddleware(
AuthMiddlewareStack(
URLRouter(
# ...
)
)
),
})
IDP_ENVIRONMENT
APP_IDENTIFIER
ROLES
FAUST_APP_PATH
IDP_URL
USE_REDIS_CACHE
False
.APP_ENTITIES
FAQs
A Django app that handles the communication between the IDP and the products for the authorization of users.
We found that django-idp-user 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.