feat: remove collection support for oauth (#15623)

Co-authored-by: Alan Rominger <arominge@redhat.com>
This commit is contained in:
Pablo H.
2024-11-19 21:08:10 +01:00
committed by Alan Rominger
parent 6599f3f827
commit 3ba6e2e394
18 changed files with 62 additions and 824 deletions

View File

@@ -1,29 +0,0 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
from awx.main.models import Organization
from awx.main.models.oauth import OAuth2Application
@pytest.mark.django_db
def test_create_application(run_module, admin_user):
org = Organization.objects.create(name='foo')
module_args = {
'name': 'foo_app',
'description': 'barfoo',
'state': 'present',
'authorization_grant_type': 'password',
'client_type': 'public',
'organization': 'foo',
}
result = run_module('application', module_args, admin_user)
assert result.get('changed'), result
application = OAuth2Application.objects.get(name='foo_app')
assert application.description == 'barfoo'
assert application.organization_id == org.id

View File

@@ -21,7 +21,9 @@ read_only_endpoints_with_modules = ['settings', 'role', 'project_update', 'workf
# If a module should not be created for an endpoint and the endpoint is not read-only add it here
# THINK HARD ABOUT DOING THIS
no_module_for_endpoint = [
'application', # Usage of OAuth tokens is deprecated
'constructed_inventory', # This is a view for inventory with kind=constructed
'token', # Usage of OAuth tokens is deprecated
]
# Some modules work on the related fields of an endpoint. These modules will not have an auto-associated endpoint
@@ -61,8 +63,6 @@ ignore_parameters = ['state', 'new_name', 'update_secrets', 'copy_from', 'is_int
no_api_parameter_ok = {
# The wait is for whether or not to wait for a project update on change
'project': ['wait', 'interval', 'update_project'],
# Existing_token and id are for working with an existing tokens
'token': ['existing_token', 'existing_token_id'],
# /survey spec is now how we handle associations
# We take an organization here to help with the lookups only
'job_template': ['survey_spec', 'organization'],

View File

@@ -20,7 +20,6 @@ def test_create_organization(run_module, admin_user):
'controller_username': None,
'controller_password': None,
'validate_certs': None,
'controller_oauthtoken': None,
'controller_config_file': None,
}
@@ -53,7 +52,6 @@ def test_galaxy_credential_order(run_module, admin_user):
'controller_username': None,
'controller_password': None,
'validate_certs': None,
'controller_oauthtoken': None,
'controller_config_file': None,
'galaxy_credentials': cred_ids,
}
@@ -78,7 +76,6 @@ def test_galaxy_credential_order(run_module, admin_user):
'controller_username': None,
'controller_password': None,
'validate_certs': None,
'controller_oauthtoken': None,
'controller_config_file': None,
'galaxy_credentials': cred_ids,
}