Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github action init error #602

Open
Oleh-Hrebchuk opened this issue May 16, 2024 · 0 comments
Open

github action init error #602

Oleh-Hrebchuk opened this issue May 16, 2024 · 0 comments

Comments

@Oleh-Hrebchuk
Copy link

def _init(self):

    if not self.verify_ssl_certs:
        self.logger.warning("WARNING: Running without SSL cert verification. "
                            "Execute 'SecretsManager(..., verify_ssl_certs=True)' or 'KSM_SKIP_VERIFY=FALSE' "
                            "to enable verification.")

    client_id = self.config.get(ConfigKeys.KEY_CLIENT_ID)

    unbound_token = False
    if self.token:
        unbound_token = True
        if client_id: # config is initialized
            client_key = self.token
            client_key_bytes = url_safe_str_to_bytes(client_key)
            client_key_hash = hmac.new(client_key_bytes, b'KEEPER_SECRETS_MANAGER_CLIENT_ID', 'sha512').digest()
            token_client_id = bytes_to_base[64](https://github.com/siete-family-foods/end-to-end/actions/runs/9108680836/job/25039966866#step:8:65)(client_key_hash)
            if token_client_id == client_id: # with same token - check if bound
                app_key = self.config.get(ConfigKeys.KEY_APP_KEY)
                if app_key: # and bound
                    unbound_token = False
                    self.logger.warning(f"The storage is already initialized with same token")
                else: # not bound
                    self.logger.warning(f"The storage is already initialized but not bound")
            else: # initialized with different token
                raise ValueError(f"The storage is already initialized with a different token - Client ID: ***client_id***")

    if client_id and not unbound_token:
        self.logger.debug("Already bound")

        if self.config.get(ConfigKeys.KEY_CLIENT_KEY):
            self.config.delete(ConfigKeys.KEY_CLIENT_KEY)

    else:

        existing_secret_key = self.load_secret_key()

        if existing_secret_key is None:
          raise ValueError("Cannot locate One Time Token.")

E ValueError: Cannot locate One Time Token.

/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/keeper_secrets_manager_core/core.py:219: ValueError
---------------------------- Captured stdout setup -----------------------------
read token
read token
Error Setup Cannot locate One Time Token.
read token
read token
Error Setup Cannot locate One Time Token.
read token
read token
Error Setup Cannot locate One Time Token.

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

No branches or pull requests

1 participant