Skip to content

Unified APERTUREDB_KEY with Cloud - #590

Merged
drewaogle merged 8 commits into
developfrom
feature/unified_key
Jun 4, 2025
Merged

drewaogle merged 8 commits into
developfrom
feature/unified_key

Conversation

@drewaogle

Copy link
Copy Markdown
Contributor

Changes the APERTUREDB_KEY format to a unified format with the cloud.

  • Changes format to v1 spec from 2025-06-02
  • Fixes some bugs related to cloning configurations which use keys

@drewaogle
drewaogle requested review from bovlb and gsaluja9 June 3, 2025 15:58
@drewaogle drewaogle self-assigned this Jun 3, 2025
Comment thread aperturedb/Connector.py Resolved
Comment thread aperturedb/ConnectorRest.py Resolved
@luisremis
luisremis requested a review from Copilot June 3, 2025 18:06
Comment thread aperturedb/Configuration.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 config is not defined in this scope; you likely intended to use conn.config.use_rest and conn.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.token was removed; without it, the connector won’t retain the auth token. Reintroduce self.token = token after setting up self.url.
self.token = token

aperturedb/Connector.py:539

  • The clone call only passes shared_data and config, 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 full config object first.
type(self)(shared_data=self.shared_data, config=self.config)

aperturedb/Configuration.py:136

  • APERTUREDB_CLOUD is undefined; the correct constant is named APERTURE_CLOUD at the top of this file.
host = "{}.farm{:04d}.{}".format(first, second, APERTUREDB_CLOUD)

aperturedb/Configuration.py:79

  • [nitpick] The return type is annotated as None but 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 either as_list[3], as_list[4] or slice as_list[3:5].
username, password = as_list[3,]

@gsaluja9 gsaluja9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@drewaogle

Copy link
Copy Markdown
Contributor Author

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

@drewaogle
drewaogle merged commit 4fa5c32 into develop Jun 4, 2025
@luisremis
luisremis deleted the feature/unified_key branch June 5, 2025 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants