Skip to content

Add geo node enable api

Alex Ives requested to merge alexives/35913/add_geo_pause_api_endpoint into master

What does this MR do?

Allow Geo secondaries to pause/unpause replication to themselves. To do this, they need to be able to toggle the enabled field of their own record in the geo_nodes table on the Geo primary.

  • Reuse the existing API endpoint PUT /geo_nodes/:id
  • Use JWT to authenticate
  • Remove enabled check in jwt auth because it would prevent unpausing, adding helper to check for paused nodes
  • Add helper method to geo node for use in upcoming MR

Relates to #35913 (closed)

For Security Review:

  • I've added security since I'm making changes to the jwt_decoder for geo tokens
  • These changes are being made to accommodate #35913 (closed), we're removing the check in the jwt decoding and replacing it with a restriction on endpoints that are not allowed while replication is paused.
  • I don't belive this impacts our ability to be secure, as pausing replication is not currently a secure way to prevent communication with a geo node (postgres replication continues).

cc @gitlab-com/gl-security/appsec

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖

Merge request reports