github.com/timstclair/heapster@v0.20.0-alpha1/Godeps/_workspace/src/k8s.io/kubernetes/pkg/auth/user/user.go (about) 1 /* 2 Copyright 2014 The Kubernetes Authors All rights reserved. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package user 18 19 // Info describes a user that has been authenticated to the system. 20 type Info interface { 21 // GetName returns the name that uniquely identifies this user among all 22 // other active users. 23 GetName() string 24 // GetUID returns a unique value for a particular user that will change 25 // if the user is removed from the system and another user is added with 26 // the same name. 27 GetUID() string 28 // GetGroups returns the names of the groups the user is a member of 29 GetGroups() []string 30 } 31 32 // DefaultInfo provides a simple user information exchange object 33 // for components that implement the UserInfo interface. 34 type DefaultInfo struct { 35 Name string 36 UID string 37 Groups []string 38 } 39 40 func (i *DefaultInfo) GetName() string { 41 return i.Name 42 } 43 44 func (i *DefaultInfo) GetUID() string { 45 return i.UID 46 } 47 48 func (i *DefaultInfo) GetGroups() []string { 49 return i.Groups 50 }