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

[SDP-913] stellar-multitenant: add config-tenant command #77

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

CaioTeixeira95
Copy link
Contributor

What

This PR adds the config-tenant CLI command in the stellar-multitenant package. This command sets the basic environment variables for the tenants individually. Each flag of the command is optional, but at least one should be provided when running it. When a flag is not provided the corresponding value in the database will not be changed. To change a value it should be explicitly passed when running the CLI.

The tenant-id is required to run the CLI.

mtn config-tenant --tenant-id abc --enable-mfa "false" --distribution-public-key "GBDYRFO3ZJ74UQ6V36D2PHXRXBYW52HKUYRYCWSFIGWQSPJMN4ARBGIF"

Why

We should be able to configure the tenants' environment variables.

Known limitations

We are still not able to set up secrets.
Missing tests for the CLI.

Checklist

PR Structure

  • This PR has reasonably narrow scope (if not, break it down into smaller PRs).
  • This PR does not mix refactoring changes with feature changes (split into two PRs otherwise).
  • This PR's title starts with the name of the package, area, or subject affected by the change.

Thoroughness

  • This PR adds tests for the new functionality or fixes.
  • This PR contains the link to the Jira ticket it addresses.

Configs and Secrets

  • No new CONFIG variables are required -OR- the new required ones were added to the helmchart's values.yaml file.
  • No new CONFIG variables are required -OR- the new required ones were added to the deployments (pr-preview, dev, demo, prd).
  • No new SECRETS variables are required -OR- the new required ones were mentioned in the helmchart's values.yaml file.
  • No new SECRETS variables are required -OR- the new required ones were added to the deployments (pr-preview secrets, dev secrets, demo secrets, prd secrets).

Release

  • This is not a breaking change.
  • This is ready for production.. If your PR is not ready for production, please consider opening additional complementary PRs using this one as the base. Only merge this into develop or main after it's ready for production!

Deployment

  • Does the deployment work after merging?

@CaioTeixeira95 CaioTeixeira95 self-assigned this Oct 24, 2023
@CaioTeixeira95 CaioTeixeira95 temporarily deployed to Anchor Integration Tests October 24, 2023 13:10 — with GitHub Actions Inactive
@CaioTeixeira95 CaioTeixeira95 temporarily deployed to Receiver Registration - E2E Integration Tests October 24, 2023 13:10 — with GitHub Actions Inactive
@CaioTeixeira95 CaioTeixeira95 temporarily deployed to Receiver Registration - E2E Integration Tests October 24, 2023 13:14 — with GitHub Actions Inactive
@CaioTeixeira95 CaioTeixeira95 temporarily deployed to Anchor Integration Tests October 24, 2023 13:14 — with GitHub Actions Inactive
Copy link
Collaborator

@marwen-abid marwen-abid left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);

CREATE UNIQUE INDEX idx_unique_name ON public.tenants (LOWER(name));
CREATE TRIGGER refresh_tenants_updated_at BEFORE UPDATE ON public.tenants FOR EACH ROW EXECUTE PROCEDURE update_at_refresh();

COMMENT ON COLUMN tenants.base_url IS 'The SDP backend server''s base URL';
COMMENT ON COLUMN tenants.sdp_ui_base_url IS 'The SDP UI/dashboard Base URL.';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

Base automatically changed from sdp-multitenant-add-tenants-cmd to sdp-multitenant October 25, 2023 16:56
@CaioTeixeira95 CaioTeixeira95 force-pushed the sdp-multitenant-config-tenant-cmd branch from f19f2e6 to dac8d6f Compare October 25, 2023 16:58
@CaioTeixeira95 CaioTeixeira95 temporarily deployed to Anchor Integration Tests October 25, 2023 16:58 — with GitHub Actions Inactive
@CaioTeixeira95 CaioTeixeira95 temporarily deployed to Receiver Registration - E2E Integration Tests October 25, 2023 16:58 — with GitHub Actions Inactive
@CaioTeixeira95 CaioTeixeira95 merged commit 67fac9b into sdp-multitenant Oct 25, 2023
6 checks passed
@CaioTeixeira95 CaioTeixeira95 deleted the sdp-multitenant-config-tenant-cmd branch October 25, 2023 17:09
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.

3 participants