Skip to content

Commit

Permalink
feat(default domain): app.speckle.systems is now default over speckle…
Browse files Browse the repository at this point in the history
….xyz (#343)

- also updates the example email domain to use the IANA owned example domain instead of a production or random domain
  • Loading branch information
iainsproat authored Jul 18, 2024
1 parent 62c5114 commit 905377d
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/specklepy/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SpeckleClient(CoreSpeckleClient):
The `SpeckleClient` is your entry point for interacting with
your Speckle Server's GraphQL API.
You'll need to have access to a server to use it,
or you can use our public server `speckle.xyz`.
or you can use our public server `app.speckle.systems`.
To authenticate the client, you'll need to have downloaded
the [Speckle Manager](https://speckle.guide/#speckle-manager)
Expand All @@ -32,7 +32,7 @@ class SpeckleClient(CoreSpeckleClient):
from specklepy.api.credentials import get_default_account
# initialise the client
client = SpeckleClient(host="speckle.xyz") # or whatever your host is
client = SpeckleClient(host="app.speckle.systems") # or whatever your host is
# client = SpeckleClient(host="localhost:3000", use_ssl=False) or use local server
# authenticate the client with an account (account has been added in Speckle Manager)
Expand All @@ -47,7 +47,7 @@ class SpeckleClient(CoreSpeckleClient):
```
"""

DEFAULT_HOST = "speckle.xyz"
DEFAULT_HOST = "app.speckle.systems"
USE_SSL = True

def __init__(
Expand Down
2 changes: 1 addition & 1 deletion src/specklepy/api/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class StreamWrapper(CoreStreamWrapper):
from specklepy.api.wrapper import StreamWrapper
# provide any stream, branch, commit, object, or globals url
wrapper = StreamWrapper("https://speckle.xyz/streams/3073b96e86/commits/604bea8cc6")
wrapper = StreamWrapper("https://app.speckle.systems/streams/3073b96e86/commits/604bea8cc6")
# get an authenticated SpeckleClient if you have a local account for the server
client = wrapper.get_client()
Expand Down
6 changes: 3 additions & 3 deletions src/specklepy/core/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SpeckleClient:
The `SpeckleClient` is your entry point for interacting with
your Speckle Server's GraphQL API.
You'll need to have access to a server to use it,
or you can use our public server `speckle.xyz`.
or you can use our public server `app.speckle.systems`.
To authenticate the client, you'll need to have downloaded
the [Speckle Manager](https://speckle.guide/#speckle-manager)
Expand All @@ -41,7 +41,7 @@ class SpeckleClient:
from specklepy.api.credentials import get_default_account
# initialise the client
client = SpeckleClient(host="speckle.xyz") # or whatever your host is
client = SpeckleClient(host="app.speckle.systems") # or whatever your host is
# client = SpeckleClient(host="localhost:3000", use_ssl=False) or use local server
# authenticate the client with an account (account has been added in Speckle Manager)
Expand All @@ -56,7 +56,7 @@ class SpeckleClient:
```
"""

DEFAULT_HOST = "speckle.xyz"
DEFAULT_HOST = "app.speckle.systems"
USE_SSL = True

def __init__(
Expand Down
2 changes: 1 addition & 1 deletion src/specklepy/core/api/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class StreamWrapper:
from specklepy.api.wrapper import StreamWrapper
# provide any stream, branch, commit, object, or globals url
wrapper = StreamWrapper("https://speckle.xyz/streams/3073b96e86/commits/604bea8cc6")
wrapper = StreamWrapper("https://app.speckle.systems/streams/3073b96e86/commits/604bea8cc6")
# get an authenticated SpeckleClient if you have a local account for the server
client = wrapper.get_client()
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def host():
def seed_user(host):
seed = uuid.uuid4().hex
user_dict = {
"email": f"{seed[0:7]}@spockle.com",
"email": f"{seed[0:7]}@example.org",
"password": "$uper$3cr3tP@ss",
"name": f"{seed[0:7]} Name",
"company": "test spockle",
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def test_stream_invite_batch(
# NOTE: only works for server admins
# invited = client.stream.invite_batch(
# stream_id=stream.id,
# emails=["userA@speckle.xyz", "userB@speckle.xyz"],
# emails=["userA@example.org", "userB@example.org"],
# user_ids=[second_user.id],
# message="yeehaw 🤠",
# )
Expand All @@ -192,7 +192,7 @@ def test_stream_invite_batch(

# invited_only_email = client.stream.invite_batch(
# stream_id=stream.id,
# emails=["userC@speckle.xyz"],
# emails=["userC@example.org"],
# message="yeehaw 🤠",
# )

Expand Down
14 changes: 10 additions & 4 deletions tests/integration/test_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,30 @@ def test_parse_globals_as_commit():


#! NOTE: the following three tests may not pass locally
# if you have a `speckle.xyz` account in manager
# if you have a `app.speckle.systems` account in manager
def test_get_client_without_auth():
wrap = StreamWrapper("https://speckle.xyz/streams/4c3ce1459c/commits/8b9b831792")
wrap = StreamWrapper(
"https://app.speckle.systems/streams/4c3ce1459c/commits/8b9b831792"
)
client = wrap.get_client()

assert client is not None


def test_get_new_client_with_token(user_path):
wrap = StreamWrapper("https://speckle.xyz/streams/4c3ce1459c/commits/8b9b831792")
wrap = StreamWrapper(
"https://app.speckle.systems/streams/4c3ce1459c/commits/8b9b831792"
)
client = wrap.get_client()
client = wrap.get_client(token="super-secret-token")

assert client.account.token == "super-secret-token"


def test_get_transport_with_token():
wrap = StreamWrapper("https://speckle.xyz/streams/4c3ce1459c/commits/8b9b831792")
wrap = StreamWrapper(
"https://app.speckle.systems/streams/4c3ce1459c/commits/8b9b831792"
)
client = wrap.get_client()
assert not client.account.token # unauthenticated bc no local accounts

Expand Down

0 comments on commit 905377d

Please sign in to comment.