diff --git a/default_config.toml b/default_config.toml index 2d0d55bfc..12682a1c1 100644 --- a/default_config.toml +++ b/default_config.toml @@ -7,6 +7,6 @@ # Fill in your authentication authentication_token = None # example token form: 071cdcce-9241-4965-93af-4a4dbc739135 # Fill in the hostname of the Cloud API -hostname = "localhost" +hostname = "platform.strawberryfields.ai" # Whether Strawberry Fields should use SSL to connect to the API use_ssl = true diff --git a/doc/introduction/configuration.rst b/doc/introduction/configuration.rst index 67a42be01..b4de977d6 100644 --- a/doc/introduction/configuration.rst +++ b/doc/introduction/configuration.rst @@ -31,7 +31,7 @@ and has the following format: [api] # Options for the Strawberry Fields cloud API authentication_token = "071cdcce-9241-4965-93af-4a4dbc739135" - hostname = "localhost" + hostname = "platform.strawberryfields.ai" use_ssl = true port = 443 @@ -44,7 +44,7 @@ Configuration options environment variable: ``SF_API_AUTHENTICATION_TOKEN`` **hostname (str)** (*optional*) - The hostname of the server to connect to. Defaults to ``localhost``. Must + The hostname of the server to connect to. Defaults to ``platform.strawberryfields.ai``. Must be one of the allowed hosts. Corresponding environment variable: ``SF_API_HOSTNAME`` diff --git a/strawberryfields/configuration.py b/strawberryfields/configuration.py index cdb07ece3..75f6185e9 100644 --- a/strawberryfields/configuration.py +++ b/strawberryfields/configuration.py @@ -32,7 +32,7 @@ DEFAULT_CONFIG_SPEC = { "api": { "authentication_token": (str, ""), - "hostname": (str, "localhost"), + "hostname": (str, "platform.strawberryfields.ai"), "use_ssl": (bool, True), "port": (int, 443), } @@ -102,7 +102,7 @@ def create_config(authentication_token="", **kwargs): dict[str, dict[str, Union[str, bool, int]]]: the configuration object """ - hostname = kwargs.get("hostname", "localhost") + hostname = kwargs.get("hostname", DEFAULT_CONFIG_SPEC["api"]["hostname"][1]) use_ssl = kwargs.get("use_ssl", DEFAULT_CONFIG_SPEC["api"]["use_ssl"][1]) port = kwargs.get("port", DEFAULT_CONFIG_SPEC["api"]["port"][1]) @@ -263,7 +263,7 @@ def store_account(authentication_token, filename="config.toml", location="user_c [api] authentication_token = "MyToken" - hostname = "localhost" + hostname = "platform.strawberryfields.ai" use_ssl = true port = 443 diff --git a/tests/frontend/test_configuration.py b/tests/frontend/test_configuration.py index e6657500d..140bc35ab 100644 --- a/tests/frontend/test_configuration.py +++ b/tests/frontend/test_configuration.py @@ -29,7 +29,7 @@ [api] # Options for the Strawberry Fields Cloud API authentication_token = "071cdcce-9241-4965-93af-4a4dbc739135" -hostname = "localhost" +hostname = "platform.strawberryfields.ai" use_ssl = true port = 443 """ @@ -43,7 +43,7 @@ EXPECTED_CONFIG = { "api": { "authentication_token": "071cdcce-9241-4965-93af-4a4dbc739135", - "hostname": "localhost", + "hostname": "platform.strawberryfields.ai", "use_ssl": True, "port": 443, } @@ -303,7 +303,7 @@ def test_valid_and_invalid_options(self): def test_only_valid_options(self): section_config_only_valid = { "authentication_token": "071cdcce-9241-4965-93af-4a4dbc739135", - "hostname": "localhost", + "hostname": "platform.strawberryfields.ai", "use_ssl": True, "port": 443, } @@ -398,7 +398,7 @@ def test_parse_environment_variable_integer(self, monkeypatch): assert conf.parse_environment_variable("some_integer", "123") == 123 -DEFAULT_KWARGS = {"hostname": "localhost", "use_ssl": True, "port": 443} +DEFAULT_KWARGS = {"hostname": "platform.strawberryfields.ai", "use_ssl": True, "port": 443} class MockSaveConfigToFile: