Skip to content

Commit

Permalink
Merge pull request #4 from twistlock/environment_settings
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
liron-l committed Jan 12, 2016
2 parents b7b1f00 + fd8b9b1 commit 484afd5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ install:
- go get golang.org/x/sys/unix
- go get github.com/tools/godep
- godep restore
script:
- make all
services:
- docker
Expand Down
10 changes: 5 additions & 5 deletions authz/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ func (f *basicAuditor) AuditRequest(req *authorization.Request, pluginRes *autho

fields := logrus.Fields{
"method": req.RequestMethod,
"uri": req.RequestURI,
"user": req.User,
"allow": pluginRes.Allow,
"msg": pluginRes.Msg,
"uri": req.RequestURI,
"user": req.User,
"allow": pluginRes.Allow,
"msg": pluginRes.Msg,
}

if pluginRes != nil ||pluginRes.Err != "" {
if pluginRes != nil || pluginRes.Err != "" {
fields["err"] = pluginRes.Err
}

Expand Down
6 changes: 3 additions & 3 deletions authz/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ func TestPolicyApply(t *testing.T) {

func TestAuditRequest(t *testing.T) {
auditor := NewBasicAuditor()
auditor.AuditRequest(&authorization.Request{User:"user"}, &authorization.Response{Allow:true})
auditor.AuditRequest(&authorization.Request{User:"user"}, nil)
auditor.AuditRequest(&authorization.Request{User: "user"}, &authorization.Response{Allow: true})
auditor.AuditRequest(&authorization.Request{User: "user"}, nil)
auditor.AuditRequest(nil, &authorization.Response{
Err:"err",
Err: "err",
})
}
2 changes: 1 addition & 1 deletion authz/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// authz package consist of specific authorization and auditing implementations
// Package authz consist of specific authorization and auditing implementations
// supported mechanism:
// basic authorization - basic policy evaluation based on JSON policy files
// basic auditing - basic auditing to log file (JSON format) - only incoming request is audited
Expand Down
2 changes: 1 addition & 1 deletion core/doc.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// core packge consist of common authorization building block required for implementing
// Package core consist of common authorization building block required for implementing
// concrete authorization logic. For example, route parsing and plugin service interface.
package core

0 comments on commit 484afd5

Please sign in to comment.