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

require authentication as 'ref' user to view ref pages #12

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dejabot
Copy link

@dejabot dejabot commented Nov 22, 2024

  • add ref password to settings
  • require either ref or admin authentication in order to access ref pages

@dejabot dejabot requested review from rcahoon and wolffg November 22, 2024 08:51
@@ -11,6 +11,10 @@ import (
// through a websockets integration, the head ref will be able to see score updates submitted by other
// refs in realtime.
func (web *Web) headrefDisplayHandler(w http.ResponseWriter, r *http.Request) {
if !web.userIsExpected(w, r, []string{adminUser, refUser}) {
Copy link
Member

Choose a reason for hiding this comment

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

should there be some sort of error message returned to the client here? something equivalent to handleWebErr

@@ -41,6 +45,10 @@ func (web *Web) headrefDisplayHandler(w http.ResponseWriter, r *http.Request) {

// The websocket endpoint for the ref display client to receive status updates.
func (web *Web) headrefDisplayWebsocketHandler(w http.ResponseWriter, r *http.Request) {
if !web.userIsExpected(w, r, []string{adminUser, refUser}) {
Copy link
Member

Choose a reason for hiding this comment

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

should there be some sort of error message returned to the client here? something equivalent to handleWebErr

@@ -58,14 +59,24 @@ func (web *Web) renderLogin(w http.ResponseWriter, r *http.Request, errorMessage
}
}

func contains(slice []string, expected string) bool {
Copy link
Member

Choose a reason for hiding this comment

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

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