Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/offering_protocol/directory/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Environment(StrEnum):
@property
def origin(self) -> str:
if self is Environment.PRODUCTION:
return "https://api.inflowpay.ai"
return "https://directory.offeringprotocol.org"
return "https://sandbox.inflowpay.ai"


Expand Down
2 changes: 1 addition & 1 deletion tests/test_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async def test_searches_continues_and_iterates_canonical_directory() -> None:
assert first_page.items[0].name == "Indica Flowers"
assert first_page.facets is not None
assert first_page.facets.trust[0].value == TrustProtocol(name=Protocol.TAP)
assert transport.requests[0].url == "https://api.inflowpay.ai/v1/services/search"
assert transport.requests[0].url == "https://directory.offeringprotocol.org/v1/services/search"
assert transport.requests[0].method == "POST"
assert transport.requests[1].method == "GET"
assert json.loads(transport.requests[0].body) == {
Expand Down
6 changes: 3 additions & 3 deletions tests/test_directory_conformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ async def test_keeps_a_continuation_on_the_canonical_origin() -> None:
await directory.continue_search_services("/v1/services/search?cursor=2")

assert directory._transport.requests[0].url == ( # type: ignore[attr-defined]
"https://api.inflowpay.ai/v1/services/search?cursor=2"
"https://directory.offeringprotocol.org/v1/services/search?cursor=2"
)


Expand All @@ -341,7 +341,7 @@ async def test_refuses_a_continuation_that_leaves_the_canonical_origin() -> None
for reference in (
"https://elsewhere.example/next",
"//elsewhere.example/next",
"https://user@api.inflowpay.ai/next",
"https://user@directory.offeringprotocol.org/next",
"mailto:someone@example.com",
):
with pytest.raises(DirectoryError):
Expand All @@ -352,7 +352,7 @@ async def test_refuses_a_continuation_that_leaves_the_canonical_origin() -> None
directory = client(json_response({"items": []}))
await directory.continue_search_services("services?cursor=2")
assert directory._transport.requests[0].url.startswith( # type: ignore[attr-defined]
"https://api.inflowpay.ai/"
"https://directory.offeringprotocol.org/"
)


Expand Down
5 changes: 4 additions & 1 deletion tests/test_directory_mixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ async def test_mixed_continuation_suggestions_and_request_validation() -> None:
transport = transport_for({"items": ["Weather forecasts"]})
names = await DirectoryClient(transport=transport).suggest(SuggestionRequest(prefix="we"))
assert names == ["Weather forecasts"]
assert transport.requests[0].url == "https://api.inflowpay.ai/v1/directory/suggestions"
assert (
transport.requests[0].url
== "https://directory.offeringprotocol.org/v1/directory/suggestions"
)
assert transport.requests[0].method == "POST"
assert json.loads(transport.requests[0].body) == {"prefix": "we"}
transport = transport_for({"items": []})
Expand Down
Loading