Authenticate Handler API and SDK, and much more (#183)

This commit is contained in:
Todd Knight authored and GitHub committed 2020-07-14 17:32:47 -04:00
1 parent acce195dcb
commit 28dbcd84bd
89 files changed
+5296 -1943

No files matched your search

+4 -11
View File
@@ -28,15 +28,8 @@ func (s Type) Prefix() string {
}[s]
}
func StringToScopeType(s string) Type {
switch s {
case Global.String():
return Global
case Org.String():
return Org
case Project.String():
return Project
default:
return Unknown
}
var Map = map[string]Type{
Global.String(): Global,
Org.String(): Org,
Project.String(): Project,
}
+2 -2
View File
@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert"
)
func Test_StringToScopeType(t *testing.T) {
func Test_Map(t *testing.T) {
tests := []struct {
name string
s string
@@ -41,7 +41,7 @@ func Test_StringToScopeType(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
assert := assert.New(t)
got := StringToScopeType(tt.s)
got := Map[tt.s]
assert.Equal(tt.want, got)
assert.Equalf(tt.wantPrefix, got.Prefix(), "unexpected prefix for %s", tt.s)
})