~gophers/goose/unstable-001

« back to all changes in this revision

Viewing changes to identity/identity.go

MergeĀ ~wallyworld/goose/client-using-identity-cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package identity
2
2
 
3
3
import (
 
4
        "fmt"
4
5
        "os"
5
6
)
6
7
 
 
8
type AuthMethod int
 
9
 
7
10
const (
8
 
        AUTH_LEGACY = iota
9
 
        AUTH_USERPASS
 
11
        AuthLegacy = AuthMethod(iota)
 
12
        AuthUserPass
10
13
)
11
14
 
 
15
func (a AuthMethod) String() string {
 
16
        switch a {
 
17
        case AuthLegacy:
 
18
                return "Legacy Authenetication"
 
19
        case AuthUserPass:
 
20
                return "Username/password Authentication"
 
21
        }
 
22
        panic(fmt.Errorf("Unknown athentication type: %d", a))
 
23
}
 
24
 
12
25
type AuthDetails struct {
13
26
        Token       string
14
27
        TenantId    string