Repository navigation
mobile sso login flow - #51
brad-defined wants to merge 1 commit into
Conversation
jasikpark
left a comment
There was a problem hiding this comment.
The client side looks right to me; nebula-apple#13 builds its SSO login on this commit. My one real ask is in the test mock: as written, the suite would still pass if the Bearer header were missing, sent on Enroll, or if list and create were swapped.
— Caleb + Cache
|
|
||
| // handlerQueued responds with the next queued mock response, regardless of request contents. Used | ||
| // for endpoints whose requests carry no fields the mock needs to validate. | ||
| func (s *Server) handlerQueued(w http.ResponseWriter, _ *http.Request) { |
There was a problem hiding this comment.
This ignores the request, so nothing checks what makes the v2 calls different from v1: the Authorization: Bearer header, the method (GET list vs POST create share a path), and which host ID the renew path carries. Could the queued entry record the method, path, and Authorization header it expects, and fail on a mismatch? That would also let a test assert that Enroll after CreateEndpointHost sends no token.
| ID string `json:"id"` | ||
| Name string `json:"name"` | ||
| NetworkID string `json:"networkID"` | ||
| IsBlocked bool `json:"isBlocked"` |
There was a problem hiding this comment.
What should a client do with a blocked host here: skip it when choosing one to renew, or renew it and expect the server to refuse? A line in the doc comment would keep the clients consistent.
Support the SSO login flow that breaks the single call into separate authenticate & add host calls (which are feature flagged in the API now.)