snapctl: add config in client to disable auth and use it in snapctl #2756

Merged
merged 3 commits into from Feb 1, 2017

Conversation

Projects
None yet
4 participants
Collaborator

mvo5 commented Feb 1, 2017

LP: #1660941

lgtm, small doc comment remark

client/client.go
@@ -63,18 +63,28 @@ type Config struct {
// BaseURL contains the base URL where snappy daemon is expected to be.
// It can be empty for a default behavior of talking over a unix socket.
BaseURL string
+
+ // DisableAuth controls if the client should try to read the auth.json
@pedronis

pedronis Feb 1, 2017

Contributor

controls whether the client should send an Authorization header from reading the auth.json data.

Contributor

jdstrand commented Feb 1, 2017

I'm not commenting on the code changes, but I was somewhat surprised that the confined config hook tried to use /root/.snap/auth.json instead of /root/snap/$SNAP_NAME/$SNAP_REVISION/.snap/auth.json. Is the config hook not going through 'snap run' for its environment setup? Should it?

Contributor

pedronis commented Feb 1, 2017

@jdstrand the code path (we are supressing here) is for the "snap" command itself, it's not for snaps, it's using $HOME/.snap directly

Contributor

pedronis commented Feb 1, 2017

@jdstrand sorry being imprecise, it's not using $HOME even, it's using the home information from "os/user".Lookup

@mvo5 mvo5 added the Critical label Feb 1, 2017

zyga approved these changes Feb 1, 2017

LGTM, extra comment sent on telegram but let's land this whenever you are ready.

@mvo5 mvo5 merged commit 2a79875 into snapcore:master Feb 1, 2017

6 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-i386 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment