auth

Paddy 2015-07-18 Parent:fc68085eb40d

180:4b68bac597b7 Go to Latest

auth/services/authd.json

Update client to detect errors. The client doesn't treat non-200 responses as errors automatically, so we need to detect when the response.Errors property is set, and use that to return an error. To avoid the boilerplate and an extensive error system, I just wrapped them in an httpErrors type that implements the error interface. That way the errors can be returned, and callers can type-cast and interrogate them. I also updated the GetLogin function to return an auth.ErrLoginNotFound error when the httpErrors response indicates that's the reason the request failed.

History
paddy@176 1 {
paddy@176 2 "kind":"Service",
paddy@176 3 "apiVersion":"v1",
paddy@176 4 "metadata":{
paddy@176 5 "name":"ducky-authd",
paddy@176 6 "labels":{
paddy@176 7 "name":"authd",
paddy@176 8 "context": "ducky",
paddy@176 9 "repo": "secondbit--authd",
paddy@176 10 "role": "auth"
paddy@176 11 }
paddy@176 12 },
paddy@176 13 "spec":{
paddy@176 14 "ports": [
paddy@176 15 {
paddy@176 16 "name": "http",
paddy@176 17 "port": 80,
paddy@176 18 "targetPort": "http"
paddy@176 19 }
paddy@176 20 ],
paddy@176 21 "selector":{
paddy@176 22 "name":"authd",
paddy@176 23 "context": "ducky",
paddy@176 24 "repo": "secondbit--authd",
paddy@176 25 "role": "auth"
paddy@176 26 },
paddy@176 27 "type": "LoadBalancer"
paddy@176 28 }
paddy@176 29 }