Skip to content

Commit

Permalink
fix(http.auth,qri.get_config): fix silly bugs from recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
b5 committed Jun 6, 2018
1 parent fc47343 commit 6f8ac60
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ func setAuth(req *http.Request, auth skylark.Tuple) error {
return fmt.Errorf("parsing auth password string: %s", err.Error())
}
req.SetBasicAuth(username, password)
return nil
}
return fmt.Errorf("expected two values for auth params tuple")
}
Expand Down
4 changes: 2 additions & 2 deletions lib/qri/qri.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ func (m *Module) AddAllMethods(sd skylark.StringDict) skylark.StringDict {
// GetConfig returns transformation configuration details
// TODO - supplying a string argument to qri.get_config('foo') should return the single config value instead of the whole map
func (m *Module) GetConfig(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error) {
if m.secrets == nil {
if m.ds.Transform.Config == nil {
return skylark.None, nil
}

var keyx skylark.Value
if err := skylark.UnpackPositionalArgs("get_secret", args, kwargs, 1, &keyx); err != nil {
if err := skylark.UnpackPositionalArgs("get_config", args, kwargs, 1, &keyx); err != nil {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion lib/qri/testdata/test.sky
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
load('qri.sky', 'qri')

cfg = qri.get_config()
foo = qri.get_config("foo")

0 comments on commit 6f8ac60

Please sign in to comment.