You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The /role_definitions/ list accepts content_type as one of the fields in the format of "aap.organization". The intent is that the first prefix is the service name, for a cluster of multiple services stitched together by the JWT and resource_registry communication.
While that's the intent, the code just ignored it, test case:
deftest_service_name_is_validated(admin_api_client):
url=get_relative_url('roledefinition-list')
response=admin_api_client.post(
url,
data={
'name': 'Random custom role',
'content_type': 'justsomerandomstuff.organization',
'permissions': ['aap.view_organization', 'local.change_organization'],
},
)
assertresponse.status_code==400, response.dataassert'service name not valid for model organization'instr(response.data)
This fails with a 201 response_code.
We already had a requirement that the model name is unique within the permission registry. This is intended to change later, to be unique within the registry for a particular service... specifically to support awx.credential and eda.credential, which is a legitimate problem.
However, since we don't have any non-synced services now, model name is safely unique by itself right now, so writing the serializers, I just stopped where I was. This is a TODO for later, as we develop a permissions-provider functionality.
The text was updated successfully, but these errors were encountered:
The
/role_definitions/
list acceptscontent_type
as one of the fields in the format of"aap.organization"
. The intent is that the first prefix is the service name, for a cluster of multiple services stitched together by the JWT and resource_registry communication.While that's the intent, the code just ignored it, test case:
This fails with a 201 response_code.
We already had a requirement that the model name is unique within the permission registry. This is intended to change later, to be unique within the registry for a particular service... specifically to support
awx.credential
andeda.credential
, which is a legitimate problem.However, since we don't have any non-synced services now, model name is safely unique by itself right now, so writing the serializers, I just stopped where I was. This is a TODO for later, as we develop a permissions-provider functionality.
The text was updated successfully, but these errors were encountered: