Module Contents¶
Classes¶
User profile, stored as named section in |
|
Local user configuration file. The data is either a plain text (unencrypted) |
|
WAMP transport URL validator. |
|
Ethereum address validator. |
|
Private key (32 bytes in HEX) validator. |
Functions¶
|
|
|
|
|
Prompt user for WAMP transport URL (eg "wss://planet.xbr.network/ws"). |
Prompt user for an Ethereum (public) address. |
|
|
Prompt user for a binary key of given length (in HEX). |
|
Attributes¶
- autobahn.xbr._config._HAS_COLOR_TERM = False¶
- autobahn.xbr._config.term¶
- class autobahn.xbr._config.Profile(path: str | None = None, name: str | None = None, member_adr: str | None = None, ethkey: bytes | None = None, cskey: bytes | None = None, username: str | None = None, email: str | None = None, network_url: str | None = None, network_realm: str | None = None, member_oid: uuid.UUID | None = None, vaction_oid: uuid.UUID | None = None, vaction_requested: numpy.datetime64 | None = None, vaction_verified: numpy.datetime64 | None = None, data_url: str | None = None, data_realm: str | None = None, infura_url: str | None = None, infura_network: str | None = None, infura_key: str | None = None, infura_secret: str | None = None)[source]¶
Bases:
object
User profile, stored as named section in
${HOME}/.xbrnetwork/config.ini
:[default] # username used with this profile username=joedoe # user email used with the profile (e.g. for verification emails) email=joe.doe@example.com # XBR network node used as a directory server and gateway to XBR smart contracts network_url=ws://localhost:8090/ws # WAMP realm on network node, usually "xbrnetwork" network_realm=xbrnetwork # user private WAMP-cryptosign key (for client authentication) cskey=0xb18bbe88ca0e189689e99f87b19addfb179d46aab3d59ec5d93a15286b949eb6 # user private Ethereum key (for signing transactions and e2e data encryption) ethkey=0xfbada363e724d4db2faa2eeaa7d7aca37637b1076dd8cf6fefde13983abaa2ef
- class autobahn.xbr._config.UserConfig(config_path)[source]¶
Bases:
object
Local user configuration file. The data is either a plain text (unencrypted) .ini file, or such a file encrypted with XSalsa20-Poly1305, and with a binary file header of 48 octets.
- property config_path: List[str]¶
Return the path to the user configuration file exposed by this object.,
- Returns:
Local filesystem path.
- property profiles: Dict[str, object]¶
Access to a map of user profiles in this user configuration.
- Returns:
Map of user profiles.
- save(password: str | None = None)[source]¶
Save this user configuration to the underlying configuration file. The user configuration file can be encrypted using Argon2id when a
password
is given.- Parameters:
password – The optional Argon2id password.
- Returns:
Number of octets written to the user configuration file.
- autobahn.xbr._config._DEFAULT_CFC_URL¶
- class autobahn.xbr._config.WampUrl[source]¶
Bases:
click.ParamType
WAMP transport URL validator.
- name = 'WAMP transport URL'¶
- convert(value, param, ctx)[source]¶
Convert the value to the correct type. This is not called if the value is
None
(the missing value).This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.
The
param
andctx
arguments may beNone
in certain situations, such as when converting prompt input.If the value cannot be converted, call
fail()
with a descriptive message.- Parameters:
value – The value to convert.
param – The parameter that is using this type to convert its value. May be
None
.ctx – The current context that arrived at this value. May be
None
.
- autobahn.xbr._config.prompt_for_wamp_url(msg, default=None)[source]¶
Prompt user for WAMP transport URL (eg “wss://planet.xbr.network/ws”).
- class autobahn.xbr._config.EthereumAddress[source]¶
Bases:
click.ParamType
Ethereum address validator.
- name = 'Ethereum address'¶
- convert(value, param, ctx)[source]¶
Convert the value to the correct type. This is not called if the value is
None
(the missing value).This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.
The
param
andctx
arguments may beNone
in certain situations, such as when converting prompt input.If the value cannot be converted, call
fail()
with a descriptive message.- Parameters:
value – The value to convert.
param – The parameter that is using this type to convert its value. May be
None
.ctx – The current context that arrived at this value. May be
None
.
- autobahn.xbr._config.prompt_for_ethereum_address(msg)[source]¶
Prompt user for an Ethereum (public) address.
- class autobahn.xbr._config.PrivateKey(key_len)[source]¶
Bases:
click.ParamType
Private key (32 bytes in HEX) validator.
- name = 'Private key'¶
- convert(value, param, ctx)[source]¶
Convert the value to the correct type. This is not called if the value is
None
(the missing value).This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.
The
param
andctx
arguments may beNone
in certain situations, such as when converting prompt input.If the value cannot be converted, call
fail()
with a descriptive message.- Parameters:
value – The value to convert.
param – The parameter that is using this type to convert its value. May be
None
.ctx – The current context that arrived at this value. May be
None
.
- autobahn.xbr._config.prompt_for_key(msg, key_len, default=None)[source]¶
Prompt user for a binary key of given length (in HEX).
- autobahn.xbr._config._DEFAULT_CONFIG = Multiline-String¶
Show Value
"""[default] # username used with this profile username={username} # user email used with the profile (e.g. for verification emails) email={email} # XBR network node used as a directory server and gateway to XBR smart contracts network_url={network_url} # WAMP realm on network node, usually "xbrnetwork" network_realm={network_realm} # user private WAMP-cryptosign key (for client authentication) cskey={cskey} # user private Ethereum key (for signing transactions and e2e data encryption) ethkey={ethkey} """