-
-
Notifications
You must be signed in to change notification settings - Fork 552
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
Add SetupKey auto-groups property #460
Conversation
Relates to |
|
||
func (h *SetupKeys) GetKeys(w http.ResponseWriter, r *http.Request) { | ||
writeSuccess(w, key) |
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 should call toResponseBody function before responding.
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.
writeSuccess function does toResponseBody
func writeSuccess(w http.ResponseWriter, key *server.SetupKey) {
w.WriteHeader(200)
w.Header().Set("Content-Type", "application/json")
err := json.NewEncoder(w).Encode(toResponseBody(key))
if err != nil {
http.Error(w, "failed handling request", http.StatusInternalServerError)
return
}
}
|
||
func (h *SetupKeys) GetKeys(w http.ResponseWriter, r *http.Request) { | ||
writeSuccess(w, key) |
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 should call toResponseBody function before responding.
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.
writeSuccess function does toResponseBody
func writeSuccess(w http.ResponseWriter, key *server.SetupKey) {
w.WriteHeader(200)
w.Header().Set("Content-Type", "application/json")
err := json.NewEncoder(w).Encode(toResponseBody(key))
if err != nil {
http.Error(w, "failed handling request", http.StatusInternalServerError)
return
}
}
UsedTimes: key.UsedTimes, | ||
LastUsed: key.LastUsed, | ||
State: state, | ||
AutoGroups: key.AutoGroups, |
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.
should we consider returning []api.GroupMinimum?
Extend Management API to add support for setup keys auto-tagging feature that allows automatic groups assignment to peers that used the key.
This PR just adds the property to the setup key.
Works as the first feature MVP for this request #458 (comment)