Skip to content

feat: added support cross app secret referencing #16

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

Merged
merged 5 commits into from
Apr 6, 2025

Conversation

nimish-ks
Copy link
Member

Added support for secret referencing across applications.

Additional changes:

  • chore: bumped dependencies
  • fix: imports

@rohan-chaturvedi you may use the following script to access secrets:

from src.phase import Phase, CreateSecretsOptions, GetAllSecretsOptions, GetSecretOptions
import os
import json

phase = Phase(
    init=False,
    pss=os.environ.get('PHASE_SERVICE_TOKEN'),
    host='https://console.phase.dev'
)

get_options = GetAllSecretsOptions(
    env_name="Development",
    secret_path="",
    app_id="443b1987-caaf-4b68-ab47-7cd49ef4ed74"
)
secrets = phase.get_all_secrets(get_options)

# Create dictionary with all fields
secrets_dict = {
    secret.key: {
        'value': secret.value,
        'comment': secret.comment,
        'path': secret.path,
        'tags': secret.tags,
        'overridden': secret.overridden,
        'application': secret.application,
        'environment': secret.environment
    } for secret in secrets
}

# Print beautified JSON
print(json.dumps(secrets_dict, indent=4))
  • Set the PHASE_SERVICE_TOKEN
  • Replace the app_id

… cross-application references. Updated the resolve_secret_reference function to handle references across different applications, improving flexibility in secret management.
@nimish-ks nimish-ks self-assigned this Mar 28, 2025
Copy link
Member

@rohan-chaturvedi rohan-chaturvedi left a comment

Choose a reason for hiding this comment

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

LGTM, everything working as expected. Needs a version bump though

@nimish-ks nimish-ks merged commit 1954fd0 into main Apr 6, 2025
1 check passed
@nimish-ks nimish-ks deleted the feat--cross-app-secret-referencing branch April 6, 2025 09:46
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.

2 participants