forked from p15670423/monkey
Island: Remove PropagationCredentials URL trailing slash
This commit is contained in:
parent
19df4d9755
commit
a67a4418c9
|
@ -11,7 +11,7 @@ _stolen_collection = "stolen-credentials"
|
||||||
|
|
||||||
|
|
||||||
class PropagationCredentials(AbstractResource):
|
class PropagationCredentials(AbstractResource):
|
||||||
urls = ["/api/propagation-credentials/", "/api/propagation-credentials/<string:collection>"]
|
urls = ["/api/propagation-credentials", "/api/propagation-credentials/<string:collection>"]
|
||||||
|
|
||||||
def __init__(self, credentials_repository: ICredentialsRepository):
|
def __init__(self, credentials_repository: ICredentialsRepository):
|
||||||
self._credentials_repository = credentials_repository
|
self._credentials_repository = credentials_repository
|
||||||
|
|
|
@ -22,8 +22,8 @@ from monkey_island.cc.resources.propagation_credentials import (
|
||||||
)
|
)
|
||||||
|
|
||||||
ALL_CREDENTIALS_URL = PropagationCredentials.urls[0]
|
ALL_CREDENTIALS_URL = PropagationCredentials.urls[0]
|
||||||
CONFIGURED_CREDENTIALS_URL = urljoin(ALL_CREDENTIALS_URL, _configured_collection)
|
CONFIGURED_CREDENTIALS_URL = urljoin(ALL_CREDENTIALS_URL + "/", _configured_collection)
|
||||||
STOLEN_CREDENTIALS_URL = urljoin(ALL_CREDENTIALS_URL, _stolen_collection)
|
STOLEN_CREDENTIALS_URL = urljoin(ALL_CREDENTIALS_URL + "/", _stolen_collection)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
@ -105,7 +105,7 @@ def test_all_propagation_credentials_endpoint__put_not_allowed(flask_client):
|
||||||
assert resp.status_code == HTTPStatus.METHOD_NOT_ALLOWED
|
assert resp.status_code == HTTPStatus.METHOD_NOT_ALLOWED
|
||||||
|
|
||||||
|
|
||||||
NON_EXISTENT_COLLECTION_URL = urljoin(ALL_CREDENTIALS_URL, "bogus-credentials")
|
NON_EXISTENT_COLLECTION_URL = urljoin(ALL_CREDENTIALS_URL + "/", "bogus-credentials")
|
||||||
|
|
||||||
|
|
||||||
def test_propagation_credentials_endpoint__get_not_found(flask_client):
|
def test_propagation_credentials_endpoint__get_not_found(flask_client):
|
||||||
|
|
Loading…
Reference in New Issue