Skip to content

Commit

Permalink
fixing remanents of old test correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Vagoasdf committed Dec 10, 2024
1 parent 4ceab3a commit f042e20
Showing 1 changed file with 0 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,72 +16,6 @@
)


@pytest.fixture(scope="function")
def oauth2_client_credentials_configuration() -> (
OAuth2ClientCredentialsAuthenticationStrategy
):
return {
"token_request": {
"method": "POST",
"path": "/oauth/token",
"headers": [
{
"name": "Content-Type",
"value": "application/x-www-form-urlencoded",
}
],
"query_params": [
{"name": "client_id", "value": "<client_id>"},
{"name": "client_secret", "value": "<client_secret>"},
{"name": "grant_type", "value": "client_credentials"},
],
}
}


@pytest.fixture(scope="function")
def oauth2_client_credentials_connection_config(
db: Session, oauth2_client_credentials_configuration
) -> Generator:
secrets = {
"domain": "localhost",
"client_id": "client",
"client_secret": "secret",
"access_token": "access",
}
saas_config = {
"fides_key": "oauth2_client_credentials_connector",
"name": "OAuth2 Client Credentials Connector",
"type": "custom",
"description": "Generic OAuth2 connector for testing",
"version": "0.0.1",
"connector_params": [{"name": item} for item in secrets.keys()],
"client_config": {
"protocol": "https",
"host": secrets["domain"],
"authentication": {
"strategy": "oauth2_client_credentials",
"configuration": oauth2_client_credentials_configuration,
},
},
"endpoints": [],
"test_request": {"method": "GET", "path": "/test"},
}

fides_key = saas_config["fides_key"]
connection_config = ConnectionConfig.create(
db=db,
data={
"key": fides_key,
"name": fides_key,
"connection_type": ConnectionType.saas,
"access": AccessLevel.write,
"secrets": secrets,
"saas_config": saas_config,
},
)
yield connection_config
connection_config.delete(db)


class TestAddAuthentication:
Expand Down

0 comments on commit f042e20

Please sign in to comment.