Skip to content
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

Merged
merged 5 commits into from
Sep 15, 2017

Conversation

oliviabarnett
Copy link
Contributor

JWTs. Authentication between nodes/server and js/server set up

@diogomonica
Copy link
Owner

Rebase needed!

@@ -0,0 +1,49 @@
package services
Copy link
Owner

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.

@@ -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,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

}

func (report *outputData) postResults(w http.ResponseWriter, r *http.Request, reqList *[]check.Request) {
w.Header().Add("Strict-Transport-Security", "max-age=63072000; includeSubDomains")
Copy link
Owner

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
Copy link
Owner

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.

@diogomonica
Copy link
Owner

Rebase needed!

Olivia Barnett added 2 commits August 22, 2017 13:51
Signed-off-by: Olivia Barnett <oliviabarnett2019@u.northwestern.edu>
@oliviabarnett oliviabarnett force-pushed the authorization-actuary branch 2 times, most recently from c904748 to c2ace6f Compare August 22, 2017 21:20
Signed-off-by: Olivia Barnett <oliviabarnett2019@u.northwestern.edu>
Tokens *handlers.Tokens
}

func randomize() []byte {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getRandomBytes

b := make([]byte, c)
_, err := rand.Read(b)
if err != nil {
log.Fatalf("Could not randomize signing key: %v", err)
Copy link
Owner

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

var username string
var ok bool

w.Header().Add("Strict-Transport-Security", "max-age=63072000; includeSubDomains")
Copy link
Owner

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>

Copy link
Owner

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;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spacing

nodeID := string(req.NodeID)
results := req.Results
report.Mu.Lock()
report.Outputs[nodeID] = results
Copy link
Owner

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

Copy link
Owner

@diogomonica diogomonica left a 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>
w.Write(report.Outputs[nodeID])
report.Mu.Unlock()
i, ok := report.Load(nodeID)
val := i.([]byte)
Copy link
Owner

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

var report = outputData{Mu: &sync.Mutex{}, Outputs: m}
//m := make(map[string][]byte)
report := syncmap.Map{}
//var report = outputData{Mu: &sync.Mutex{}, Outputs: m}
Copy link
Owner

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>
@diogomonica diogomonica merged commit 7cc23f2 into diogomonica:master Sep 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants