auth

Paddy 2015-06-29 Parent:b0d1b3e39fc8 Child:4b68bac597b7

176:fc68085eb40d Go to Latest

auth/client/login.go

Add kubernetes definitions. Define a replication controller that will spin up authd servers (using Ducky right now--other instances should rename the ducky parts appropriately). Also, my understanding of which labels go where may be shaky, which is probably evidenced by the fact that all of these things share the same lables. _Whatever_. It also hooks the generated pods up to the JWT secret volume, so they can properly read the JWT secret. Also, created a LoadBalancer Service that will route traffic to the pods created by the Replication Controller.

History
paddy@172 1 package client
paddy@172 2
paddy@172 3 import (
paddy@172 4 "code.secondbit.org/auth.hg"
paddy@172 5 )
paddy@172 6
paddy@172 7 func (c *Client) GetLogin(value string) (auth.Login, error) {
paddy@173 8 resp, err := c.Get("/logins/"+value, auth.Scopes{auth.ScopeLoginAdmin}.Strings(), nil)
paddy@172 9 if err != nil {
paddy@172 10 return auth.Login{}, err
paddy@172 11 }
paddy@172 12 if len(resp.Logins) < 1 {
paddy@172 13 return auth.Login{}, auth.ErrLoginNotFound
paddy@172 14 }
paddy@172 15 return resp.Logins[0], nil
paddy@172 16 }