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

feat: introduce /.well-known endpoint for service discovery information #3632

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

shreddedbacon
Copy link
Member

@shreddedbacon shreddedbacon commented Dec 27, 2023

General Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for inclusion in changelog

Database Migrations

  • If your PR contains a database migation, it MUST be the latest in date order alphabetically

Just a simple way to expose some discovery data via a /.well-known/appspecific/sh.lagoon.discovery.json endpoint.

This could expose other information too, and for tools like lagoon-cli and lagoon-sync, users only need to know the API hostname (and maybe port if not standard http/s) when configuring their tools, rather than needing to know all the other endpoint information.

This contains some basic information like so, as long as the variables are provided to populate it correctly. Some are already provided by the chart, others will need to be created in the chart

{
    "lagoon_version": "v2.17.0",
    "authorization_endpoint": "https://keycloak.example.com",
    "ssh_token_exchange": {
        "token_endpoint_host": "token.example.com",
        "token_endpoint_port": 22
    },
    "webhook_endpoint": "https://webhook.example.com",
    "ui_url": "https://ui.example.com"
}

This requires updates to the charts to inject SSH_TOKEN_ENDPOINT and SSH_TOKEN_ENDPOINT_PORT variables that require a user to define, the port may be able to be consumed via the chart though, so only the hostname would need to be provided.

Conditions for the endpoint DNS record would be if this is a fresh install of the token or ssh service, the cluster loadbalancer/service IP or name for the token endpoint may not be known immediately, so could be set to the DNS record that will eventually be populated once the loadbalancer/service IP is know after deployment.

@shreddedbacon shreddedbacon force-pushed the discovery-endpoint branch 3 times, most recently from efdd6fc to e34d366 Compare December 27, 2023 06:17
@shreddedbacon shreddedbacon added this to the 2.18.0 milestone Jan 17, 2024
@shreddedbacon shreddedbacon changed the title feat: introduce discovery data to status endpoint feat: introduce /.well-known/lagoon endpoint Jan 18, 2024
@shreddedbacon shreddedbacon force-pushed the discovery-endpoint branch 2 times, most recently from 0ff63c7 to daf78b6 Compare January 18, 2024 23:16
@smlx
Copy link
Member

smlx commented Jan 19, 2024

IANA has an appspecific URI suffix for this purpose that you might be able to use. I guess it would be something like /.well-known/appspecific/sh.lagoon.discovery.json?

@shreddedbacon
Copy link
Member Author

shreddedbacon commented Jan 19, 2024

IANA has an appspecific URI suffix for this purpose that you might be able to use. I guess it would be something like /.well-known/appspecific/sh.lagoon.discovery.json?

Yeah, that can work too

Just would have been nicer to use /.well-known/lagoon from a vanity perspective ✨

@shreddedbacon shreddedbacon changed the title feat: introduce /.well-known/lagoon endpoint feat: introduce /.well-known endpoint Jan 19, 2024
@shreddedbacon shreddedbacon marked this pull request as ready for review February 1, 2024 02:05
@shreddedbacon shreddedbacon changed the title feat: introduce /.well-known endpoint feat: introduce /.well-known endpoint for service discovery information Feb 1, 2024
@tobybellwood tobybellwood self-requested a review February 1, 2024 23:28
Copy link
Member

@rocketeerbkw rocketeerbkw left a comment

Choose a reason for hiding this comment

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

Also discussed in meeting, agreed this URL scheme shouldn't cause future headaches.

@tobybellwood tobybellwood merged commit ad08dbe into main Feb 6, 2024
1 check passed
@tobybellwood tobybellwood deleted the discovery-endpoint branch February 6, 2024 20:41
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