Repository navigation
Unified APERTUREDB_KEY with Cloud - #590
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the APERTUREDB_KEY handling to the new unified v1 spec and adjusts connector code paths that rely on those keys.
- Switches CLI key generation to
create_aperturedb_key - Refactors Connector and ConnectorRest to initialize from reinflated config and revises clone behavior
- Overhauls Configuration serialization (
deflate→create_aperturedb_key) and reinflation logic
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| aperturedb/cli/keys.py | Updated key generation call to new create_aperturedb_key |
| aperturedb/ConnectorRest.py | Adjusted URL construction and removed token assignment |
| aperturedb/Connector.py | Changed __init__ to use reinflated config and modified clone |
| aperturedb/Configuration.py | Replaced old deflate/reinflate with new key serialization scheme |
Comments suppressed due to low confidence (6)
aperturedb/cli/keys.py:26
- The variable
configis not defined in this scope; you likely intended to useconn.config.use_restandconn.config.use_ssl.
key = Configuration.create_aperturedb_key(conn.config.host, conn.config.port, token, config.use_rest, config.use_ssl)
aperturedb/ConnectorRest.py:94
- Reassigning
self.tokenwas removed; without it, the connector won’t retain the auth token. Reintroduceself.token = tokenafter setting upself.url.
self.token = token
aperturedb/Connector.py:539
- The
clonecall only passesshared_dataandconfig, omitting host, port, credentials, token, and flags. This will default important settings instead of cloning them. Consider forwarding the original parameters or updating__init__to accept a fullconfigobject first.
type(self)(shared_data=self.shared_data, config=self.config)
aperturedb/Configuration.py:136
APERTUREDB_CLOUDis undefined; the correct constant is namedAPERTURE_CLOUDat the top of this file.
host = "{}.farm{:04d}.{}".format(first, second, APERTUREDB_CLOUD)
aperturedb/Configuration.py:79
- [nitpick] The return type is annotated as
Nonebut the function returns the encoded key string. Update the annotation to-> str.
def create_aperturedb_key(... ) -> None:
aperturedb/Configuration.py:123
- Invalid indexing with
as_list[3,]; to unpack username and password use eitheras_list[3], as_list[4]or sliceas_list[3:5].
username, password = as_list[3,]
gsaluja9
left a comment
There was a problem hiding this comment.
Looks good. A minor comment for aperturedb/cli/configure.py
the check_configured for config commands will incorrectly report false, if config file is not present. For example, adb config ls , without the config file.
Yeah, I think reworking the config script stuff is a good idea soon, if you make an issue with what went wrong, then whoever gets to it first can know what was the mistake |
Changes the APERTUREDB_KEY format to a unified format with the cloud.