Skip to content

Conversation

@pcholakov
Copy link
Contributor

With this change:

  • restate cloud login will always fetch https://cloud.restate.dev/.idp-config and attempt to configure itself based on that, unless there is a local override already; the thinking is users don't do this more than ~once a day, so we're not gaining much from waiting, and might confuse things when the default does eventually change
  • this route could also live on the Cloud API side but the advantage is that we can flip both the UI and CLI defaults with a single deployment of the Cloud UI
  • the WorkOS idp supports the more modern OAuth device flow which relies on long polling

@github-actions
Copy link

github-actions bot commented Nov 25, 2025

Test Results

  7 files  ±0    7 suites  ±0   3m 16s ⏱️ +6s
 47 tests ±0   47 ✅ ±0  0 💤 ±0  0 ❌ ±0 
200 runs  ±0  200 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit ea36f66. ± Comparison against base commit 35498b4.

♻️ This comment has been updated with latest results.


use super::IdentityProvider;

const IDENTITY_PROVIDER_DISCOVERY_URL: &str = "https://cloud.restate.dev/.idp-config";
Copy link
Contributor

Choose a reason for hiding this comment

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

here's what i do now to do dev logins:

cat ~/.config/restate-dev/config.toml
[global]

[global.cloud]
api_base_url = "https://api.dev.restate.cloud"
login_base_url = "https://auth-dev.restate.cloud"
client_id = "cua6drm2md11pur6d5blnj9d4"

could this idp url come from config too, so i could just have the dev url in my config and then be used to get the other values if they are unset?

fn default() -> Self {
Self {
environment_info: None,
provider: IdentityProvider::Cognito { client_id: None },
Copy link
Contributor

Choose a reason for hiding this comment

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

could this be simpler:

  1. default provider is IdentityProvider::Idp with the prod idp url (but my dev cli config can override this)
  2. if provider is idp, load from idp, fail if this doesnt work
  3. otherwise, use the values from config, but a none client id isnt allowed

there would be no parsing the config file to see if an override is set, and dev cli configs just need a single field set. but you can still skip idp if you have a specific provider set in config

Copy link
Contributor Author

Choose a reason for hiding this comment

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

very reasonable!

@pcholakov
Copy link
Contributor Author

pcholakov commented Nov 26, 2025

I haven't tested the individual field overrides, but your suggestion works great - I've added the API base URL so now you'll be able to just do this and be set up with the dev defaults:

[global.cloud]
config_discovery_url = "https://dev.cloud.restate.dev/.auth-config"

Will update https://github.com/restatedev/restate-cloud-ui/pull/133 to include the extra fields and new route path.

pub client_id: String,
pub redirect_ports: Vec<u16>,
pub config_discovery_url: Option<Url>,
pub provider: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe bikeshedding but i had imagined that we just have an IdentityProvider enum with Discover/Cognito/WorkOS all as options. so in your config you can either override the discover url, or you can manually set the provider to cognito at some client id, or manually set to workod at some client id

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It made a bit more sense to me to do it this way – basically override individual parameters of the discovered remote config. I think it makes a lot of sense to do what you want if we weren't ourselves in control of both ends, but since it's just us who will end up using this, I think it's more convenient the way it is, even if it makes it a bit easier to break things. But again, since it's only a handful of Restate engineers who will ever make use of these, I think it's ok. I know you're easy with this but if you prefer it the way you suggested, I'll happily change it – it's definitely a more sound approach.

Copy link
Contributor

Choose a reason for hiding this comment

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

youre closer to the problem - lets go with your instinct!

Copy link
Contributor

@jackkleeman jackkleeman left a comment

Choose a reason for hiding this comment

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

makes sense to me, left a stylistic comment about the overrides but since almost no one would set those, it matters very little

@pcholakov
Copy link
Contributor Author

pcholakov commented Nov 26, 2025

Ack! I'm not in a rush to merge this, and will happily change it if you feel it should work that way.

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