~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/gopkg.in/goose.v1/testservices/identityservice/userpass.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
        Region      string `json:"region"`
39
39
}
40
40
 
41
 
type Service struct {
 
41
type V2Service struct {
42
42
        Name      string `json:"name"`
43
43
        Type      string `json:"type"`
44
44
        Endpoints []Endpoint
68
68
 
69
69
type AccessResponse struct {
70
70
        Access struct {
71
 
                ServiceCatalog []Service     `json:"serviceCatalog"`
 
71
                ServiceCatalog []V2Service   `json:"serviceCatalog"`
72
72
                Token          TokenResponse `json:"token"`
73
73
                User           UserResponse  `json:"user"`
74
74
        } `json:"access"`
141
141
type UserPass struct {
142
142
        hook.TestService
143
143
        Users
144
 
        services []Service
 
144
        services []V2Service
145
145
}
146
146
 
147
147
func NewUserPass() *UserPass {
148
148
        userpass := &UserPass{
149
 
                services: make([]Service, 0),
 
149
                services: make([]V2Service, 0),
150
150
        }
151
151
        userpass.users = make(map[string]UserInfo)
152
152
        userpass.tenants = make(map[string]string)
154
154
}
155
155
 
156
156
func (u *UserPass) RegisterServiceProvider(name, serviceType string, serviceProvider ServiceProvider) {
157
 
        service := Service{name, serviceType, serviceProvider.Endpoints()}
158
 
        u.AddService(service)
 
157
        service := V2Service{name, serviceType, serviceProvider.Endpoints()}
 
158
        u.AddService(Service{V2: service})
159
159
}
160
160
 
161
161
func (u *UserPass) AddService(service Service) {
162
 
        u.services = append(u.services, service)
 
162
        u.services = append(u.services, service.V2)
163
163
}
164
164
 
165
165
var internalError = []byte(`{