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

REALMC-11391: Support local-userpass auth provider type for login #244

Merged
merged 5 commits into from
Jan 21, 2022

Conversation

makesitgo
Copy link
Contributor

@makesitgo makesitgo commented Jan 12, 2022

Mentioned this in the JIRA, but this functionality was technically missed when going from v1 to v2, see: https://github.com/10gen/realm-cli/blob/support/1.3.x/auth/auth.go

Not sure how far we should go to support these use cases of "self-contained Realm instances" when testing in CI/CD environments, but Nikola reached out asking me about this so it's safe to say we have at least one real use-case for all of this


At some point, you may wish to configure which Realm and Atlas servers the CLI is connecting to. By default, these URLs point to the Production instances of Realm and Atlas, which should be sufficient for most use cases.

However, you can set `--realm-url` and `--atlas-url` to any URLs you know a respective server instance is running at. If you are configuring one, chances are you'll want to configure both of these.
Copy link
Collaborator

Choose a reason for hiding this comment

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

wouldn't you always need to configure both? not sure how realm dev would work with cloud qa for example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the one a-typical scenario thats come up in practice is local+dev, but the technicality still remains that you'd be setting both of those at once.

also, if you didn't heed this advice, then you'd read it and say "oh yeah, those chances were right! but now I only need to set one" :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder if you could ever rig up a local Realm + prod Atlas env...

internal/commands/login/inputs_test.go Outdated Show resolved Hide resolved
Copy link
Contributor Author

@makesitgo makesitgo left a comment

Choose a reason for hiding this comment

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

got burned by "pending review" instead of just submitting comments... submitting them now

assert.Nil(t, err)
assert.NotEqual(t, "", session.AccessToken, "access token must not be blank")
assert.NotEqual(t, "", session.RefreshToken, "refresh token must not be blank")
})
}

func TestRealmAuthenticateLocal(t *testing.T) {
t.Skip("this test needs to run with a local Realm server configured to support the local-userpass auth provider")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

wondering if its worth tying to modify the test_cli.json server config to support local-userpass ... would probably also have to insert a test user, which wouldn't be all that reliable when running the tests locally. any thoughts here from the crowd?


At some point, you may wish to configure which Realm and Atlas servers the CLI is connecting to. By default, these URLs point to the Production instances of Realm and Atlas, which should be sufficient for most use cases.

However, you can set `--realm-url` and `--atlas-url` to any URLs you know a respective server instance is running at. If you are configuring one, chances are you'll want to configure both of these.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the one a-typical scenario thats come up in practice is local+dev, but the technicality still remains that you'd be setting both of those at once.

also, if you didn't heed this advice, then you'd read it and say "oh yeah, those chances were right! but now I only need to set one" :)


At some point, you may wish to configure which Realm and Atlas servers the CLI is connecting to. By default, these URLs point to the Production instances of Realm and Atlas, which should be sufficient for most use cases.

However, you can set `--realm-url` and `--atlas-url` to any URLs you know a respective server instance is running at. If you are configuring one, chances are you'll want to configure both of these.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder if you could ever rig up a local Realm + prod Atlas env...

@makesitgo
Copy link
Contributor Author

test failure is currently related to https://github.com/10gen/baas/pull/5563/files. proceeding with the merge

@makesitgo makesitgo merged commit 465253c into 10gen:master Jan 21, 2022
@makesitgo makesitgo deleted the REALMC-11391 branch January 21, 2022 21:28
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.

None yet

3 participants