-
Notifications
You must be signed in to change notification settings - Fork 14
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
Authorization actuary #34
Authorization actuary #34
Conversation
Rebase needed! |
cmd/actuary/server/services/acl.go
Outdated
@@ -0,0 +1,49 @@ | |||
package services |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a bit too complex. We don't actually need user-management.
cmd/actuary/server/server.go
Outdated
@@ -68,7 +113,16 @@ var ( | |||
TLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler), 0), | |||
} | |||
|
|||
api := NewAPI(os.Getenv("TLS_CERT"), os.Getenv("TLS_KEY")) | |||
|
|||
// mux.Handle("/users", AddMiddleware(api.Users, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
cmd/actuary/server/server.go
Outdated
} | ||
|
||
func (report *outputData) postResults(w http.ResponseWriter, r *http.Request, reqList *[]check.Request) { | ||
w.Header().Add("Strict-Transport-Security", "max-age=63072000; includeSubDomains") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not a good idea for a website that won't have a valid TLS cert?
@@ -0,0 +1,106 @@ | |||
package server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any tests of this functionality.
Rebase needed! |
Signed-off-by: Olivia Barnett <oliviabarnett2019@u.northwestern.edu>
c904748
to
c2ace6f
Compare
Signed-off-by: Olivia Barnett <oliviabarnett2019@u.northwestern.edu>
c2ace6f
to
1c7e179
Compare
cmd/actuary/server/api.go
Outdated
Tokens *handlers.Tokens | ||
} | ||
|
||
func randomize() []byte { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getRandomBytes
cmd/actuary/server/api.go
Outdated
b := make([]byte, c) | ||
_, err := rand.Read(b) | ||
if err != nil { | ||
log.Fatalf("Could not randomize signing key: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed when generating random bytes
cmd/actuary/server/handlers/token.go
Outdated
var username string | ||
var ok bool | ||
|
||
w.Header().Add("Strict-Transport-Security", "max-age=63072000; includeSubDomains") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this header.
@@ -12,6 +12,7 @@ | |||
</head> | |||
|
|||
<body> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
@@ -73,3 +73,15 @@ ul { | |||
list-style-type: disc; | |||
font-size: large; | |||
} | |||
|
|||
.input-box{ | |||
height: 3em; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spacing
cmd/actuary/server/server.go
Outdated
nodeID := string(req.NodeID) | ||
results := req.Results | ||
report.Mu.Lock() | ||
report.Outputs[nodeID] = results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also use the new sync.Map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nits.
Signed-off-by: Olivia Barnett <oliviabarnett2019@u.northwestern.edu>
cmd/actuary/server/server.go
Outdated
w.Write(report.Outputs[nodeID]) | ||
report.Mu.Unlock() | ||
i, ok := report.Load(nodeID) | ||
val := i.([]byte) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this after the !ok
check
cmd/actuary/server/server.go
Outdated
var report = outputData{Mu: &sync.Mutex{}, Outputs: m} | ||
//m := make(map[string][]byte) | ||
report := syncmap.Map{} | ||
//var report = outputData{Mu: &sync.Mutex{}, Outputs: m} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are there comments?
Signed-off-by: Olivia Barnett <oliviabarnett2019@u.northwestern.edu>
JWTs. Authentication between nodes/server and js/server set up