-
Notifications
You must be signed in to change notification settings - Fork 712
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
Allow user to specify URLs on the command line, and use that to allow per-target tokens. #1901
Conversation
So currently you need to use this like this:
I feel like we should:
@2opremio WDYT? |
When were users introduced as part of the authentication? I thought that the probe only required a token. Also, we should review, update and redeploy the Scope documentation/guides (and maybe blogposts) before merging this since it changes how we launch Scope.
Uhm, that's a tricky one. I would only default 80/443 if omitted when providing the scheme. Defaulting 4040 when you are providing the scheme feels too magical to me. If you want to preserve the current behaviour then I would propose to omit the scheme, default to 4040 if the port is omitted and force using 80/443(https) explicitly. This is what I believe we do right now.
I still don't fully understand the role of users when pushing reports from probes. Users have their own token now? |
They are not, the user part of the URL is ignored.
This is backwards compatible - if you don't specify a password in the URL, the one from
Sorry if it wasn't clear - that was the suggestion. Looks like we agree!
As an aside, there are user tokens now, but this is not what I'm using here (and I don't propose we do, as it makes it harder) |
Not when using explicit targets, at least if we don't default to 4040 when not providing the scheme (which would be a bit odd).
Then let's use the user part of the URL as a token instead of the password.
Great :) |
I'm confused - how about if we:
That should be backwards compatible, right? Can you give an example where it isn't? |
It would, but defaulting to different ports based on whether the scheme is However, I don't see a better solution, so go ahead. On Oct 4, 2016 21:07, "Tom Wilkie" notifications@github.com wrote:
|
Okay with latest changes user can now do:
Which is much cleaner. Should be good to merge now? |
LGTM, please squash. |
@@ -43,7 +44,7 @@ func TestControl(t *testing.T) { | |||
Value: "foo", | |||
} | |||
}) | |||
client, err := appclient.NewAppClient(probeConfig, ip+":"+port, ip+":"+port, controlHandler) | |||
client, err := appclient.NewAppClient(probeConfig, ip+":"+port, url.URL{Scheme: "http", Host: ip + ":" + port}, controlHandler) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@@ -83,7 +84,7 @@ func TestPipeClose(t *testing.T) { | |||
probeConfig := appclient.ProbeConfig{ | |||
ProbeID: "foo", | |||
} | |||
client, err := appclient.NewAppClient(probeConfig, ip+":"+port, ip+":"+port, nil) | |||
client, err := appclient.NewAppClient(probeConfig, ip+":"+port, url.URL{Scheme: "http", Host: ip + ":" + port}, nil) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
… per-target tokens. Also: - Parse targets on startup and catch badly formed ones before Scope can start. - If no port is specified, use default port for scheme; if no scheme is specificed, use 4040. - Use username as probe token
de5890a
to
2ea2c4a
Compare
Fixes #1696