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(*) validate token requirement #418

Merged
merged 3 commits into from
Nov 11, 2019

Conversation

jakubdyszkiewicz
Copy link
Contributor

Summary

  • Changed dataplane-token to dataplane-token-file
  • Validate if token is present when dataplane token server is run.
  • Better error on kumactl when server is not run.

@jakubdyszkiewicz jakubdyszkiewicz requested a review from a team November 8, 2019 18:22
@jakubdyszkiewicz jakubdyszkiewicz force-pushed the feature/kuma-dp-validate-token-server branch from 78e238d to 2864227 Compare November 8, 2019 18:23
@@ -134,6 +134,9 @@ func (rc *RootContext) CurrentDataplaneTokenClient() (tokens.DataplaneTokenClien
if err != nil {
return nil, err
}
if !components.Apis.DataplaneToken.Enabled() {
return nil, errors.New("Dataplane Token Server in Kuma CP is disabled. Either enable the server or run Kuma DP without token.")
Copy link
Contributor

Choose a reason for hiding this comment

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

or run Kuma DP without token

Why is this message about Kuma DP ? It's app/kumactl/pkg/cmd/root_context.go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When dataplane token server is disabled user can either enable the server to generate token or just run kuma dp without token. Do you think we skip the running kuma dp without token option?

Expect(err).To(HaveOccurred())

// and
Expect(buf.String()).To(Equal("Error: failed to create dataplane token client: Dataplane Token Server in Kuma CP is disabled. Either enable the server or run Kuma DP without token.\n"))
Copy link
Contributor

Choose a reason for hiding this comment

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

or run Kuma DP without token

Why is this message about Kuma DP ? It's app/kumactl/cmd/generate/generate_dataplane_token_test.go

@jakubdyszkiewicz jakubdyszkiewicz force-pushed the feature/kuma-dp-validate-token-server branch from 2864227 to b55c527 Compare November 11, 2019 14:50
@jakubdyszkiewicz jakubdyszkiewicz changed the base branch from feature/kuma-dp-use-catalogue to master November 11, 2019 15:00
@jakubdyszkiewicz jakubdyszkiewicz merged commit 12485cd into master Nov 11, 2019
@jakubdyszkiewicz jakubdyszkiewicz deleted the feature/kuma-dp-validate-token-server branch November 11, 2019 16:30
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

2 participants