From 9c2d6b7b9ff036f47e25d07a14dcfac800c50e60 Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 3 Mar 2020 14:01:07 -0500 Subject: [PATCH 1/2] localhost -> platform.xanadu.ai --- default_config.toml | 2 +- doc/introduction/configuration.rst | 4 ++-- doc/introduction/starship.rst | 4 ++-- strawberryfields/configuration.py | 6 +++--- tests/frontend/test_configuration.py | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/default_config.toml b/default_config.toml index 2d0d55bfc..50928e2d6 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.xanadu.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..f2621c8fe 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.xanadu.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.xanadu.ai``. Must be one of the allowed hosts. Corresponding environment variable: ``SF_API_HOSTNAME`` diff --git a/doc/introduction/starship.rst b/doc/introduction/starship.rst index 940991e32..cba3c747f 100644 --- a/doc/introduction/starship.rst +++ b/doc/introduction/starship.rst @@ -18,7 +18,7 @@ working directory. A typical file looks like this: .. code-block:: toml [api] - hostname = "platform.strawberryfields.ai" + hostname = "platform.xanadu.ai" authentication_token = "ElUFm3O6m6q1DXPmpi5g4hWEhYHXFxBc" You can generate this file interactively by using the ``starship`` command as follows, answering the questions in the prompts. @@ -26,7 +26,7 @@ You can generate this file interactively by using the ``starship`` command as fo .. code-block:: text $ starship --reconfigure - Please enter the hostname of the server to connect to: [localhost] platform.strawberryfields.ai + Please enter the hostname of the server to connect to: [localhost] platform.xanadu.ai Please enter the authentication token to use when connecting: [] ElUFm3O6m6q1DXPmpi5g4hWEhYHXFxBc Would you like to save these settings to a local cofiguration file in the current directory? [Y/n] y Writing configuration file to current working directory... diff --git a/strawberryfields/configuration.py b/strawberryfields/configuration.py index cdb07ece3..7a30cbca9 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.xanadu.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.xanadu.ai" use_ssl = true port = 443 diff --git a/tests/frontend/test_configuration.py b/tests/frontend/test_configuration.py index e6657500d..5d2b8d995 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.xanadu.ai" use_ssl = true port = 443 """ @@ -43,7 +43,7 @@ EXPECTED_CONFIG = { "api": { "authentication_token": "071cdcce-9241-4965-93af-4a4dbc739135", - "hostname": "localhost", + "hostname": "platform.xanadu.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.xanadu.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.xanadu.ai", "use_ssl": True, "port": 443} class MockSaveConfigToFile: From e1c321cea9966c9caa9350f5c7e28e1af1ad69a7 Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 3 Mar 2020 14:36:45 -0500 Subject: [PATCH 2/2] Changing hostname occurrences to platform.strawberryfields.ai --- default_config.toml | 2 +- doc/introduction/configuration.rst | 4 ++-- doc/introduction/starship.rst | 4 ++-- strawberryfields/configuration.py | 4 ++-- tests/frontend/test_configuration.py | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/default_config.toml b/default_config.toml index 50928e2d6..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 = "platform.xanadu.ai" +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 f2621c8fe..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 = "platform.xanadu.ai" + 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 ``platform.xanadu.ai``. 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/doc/introduction/starship.rst b/doc/introduction/starship.rst index cba3c747f..940991e32 100644 --- a/doc/introduction/starship.rst +++ b/doc/introduction/starship.rst @@ -18,7 +18,7 @@ working directory. A typical file looks like this: .. code-block:: toml [api] - hostname = "platform.xanadu.ai" + hostname = "platform.strawberryfields.ai" authentication_token = "ElUFm3O6m6q1DXPmpi5g4hWEhYHXFxBc" You can generate this file interactively by using the ``starship`` command as follows, answering the questions in the prompts. @@ -26,7 +26,7 @@ You can generate this file interactively by using the ``starship`` command as fo .. code-block:: text $ starship --reconfigure - Please enter the hostname of the server to connect to: [localhost] platform.xanadu.ai + Please enter the hostname of the server to connect to: [localhost] platform.strawberryfields.ai Please enter the authentication token to use when connecting: [] ElUFm3O6m6q1DXPmpi5g4hWEhYHXFxBc Would you like to save these settings to a local cofiguration file in the current directory? [Y/n] y Writing configuration file to current working directory... diff --git a/strawberryfields/configuration.py b/strawberryfields/configuration.py index 7a30cbca9..75f6185e9 100644 --- a/strawberryfields/configuration.py +++ b/strawberryfields/configuration.py @@ -32,7 +32,7 @@ DEFAULT_CONFIG_SPEC = { "api": { "authentication_token": (str, ""), - "hostname": (str, "platform.xanadu.ai"), + "hostname": (str, "platform.strawberryfields.ai"), "use_ssl": (bool, True), "port": (int, 443), } @@ -263,7 +263,7 @@ def store_account(authentication_token, filename="config.toml", location="user_c [api] authentication_token = "MyToken" - hostname = "platform.xanadu.ai" + hostname = "platform.strawberryfields.ai" use_ssl = true port = 443 diff --git a/tests/frontend/test_configuration.py b/tests/frontend/test_configuration.py index 5d2b8d995..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 = "platform.xanadu.ai" +hostname = "platform.strawberryfields.ai" use_ssl = true port = 443 """ @@ -43,7 +43,7 @@ EXPECTED_CONFIG = { "api": { "authentication_token": "071cdcce-9241-4965-93af-4a4dbc739135", - "hostname": "platform.xanadu.ai", + "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": "platform.xanadu.ai", + "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": "platform.xanadu.ai", "use_ssl": True, "port": 443} +DEFAULT_KWARGS = {"hostname": "platform.strawberryfields.ai", "use_ssl": True, "port": 443} class MockSaveConfigToFile: