Skip to content

Configure JWT gateway authentication#30

Open
abikouo wants to merge 1 commit into
ansible:mainfrom
abikouo:jwt_gateway_auth
Open

Configure JWT gateway authentication#30
abikouo wants to merge 1 commit into
ansible:mainfrom
abikouo:jwt_gateway_auth

Conversation

@abikouo

@abikouo abikouo commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

This draft pull request addresses concerns from https://issues.redhat.com/browse/AAP-47177.

  • Regarding the authentication, we can rely on the Gateway authentication JWT token; the only thing we have to do is to add the following configuration in the settings
REST_FRAMEWORK = {
    "DEFAULT_AUTHENTICATION_CLASSES": [
        "pattern_service.authentication.PatternServiceJWTAuthentication",
    ],
    "DEFAULT_PERMISSION_CLASSES": [
        "ansible_base.rbac.api.permissions.AnsibleBaseObjectPermissions",
    ],
}

Some ANSIBLE_BASE* variables also need to be defined
However, we still need to define a User model in our app, even if this is not used to store user information. As the django-ansible-base is not well-documented, this may require further investigation to determine if it can be removed.

  • Regarding the created_by and modified_by, these fields cannot be updated as they are defined now with the user's Ansible ID from the Gateway because they are currently defined as ForeignKey. This prototype adds a new field created_by_ansible_id which will store the user's Ansible ID. Another solution is to update these fields

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant