Skip to content
This repository was archived by the owner on Feb 16, 2022. It is now read-only.

Commit b822c96

Browse files
author
Yvo
authored
Merge pull request #212 from nicholaswold/master
Support google-apps connection strategy
2 parents 467727b + 24e1198 commit b822c96

File tree

3 files changed

+136
-1
lines changed

3 files changed

+136
-1
lines changed

management/connection.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const (
2626
ConnectionStrategyAD = "ad"
2727
ConnectionStrategyAzureAD = "waad"
2828
ConnectionStrategySAML = "samlp"
29+
ConnectionStrategyGoogleApps = "google-apps"
2930
)
3031

3132
type Connection struct {
@@ -149,6 +150,8 @@ func (c *Connection) UnmarshalJSON(b []byte) error {
149150
v = &ConnectionOptionsAzureAD{}
150151
case ConnectionStrategySAML:
151152
v = &ConnectionOptionsSAML{}
153+
case ConnectionStrategyGoogleApps:
154+
v = &ConnectionOptionsGoogleApps{}
152155
default:
153156
v = make(map[string]interface{})
154157
}
@@ -704,6 +707,26 @@ type ConnectionOptionsSAMLIdpInitiated struct {
704707
NonPersistentAttrs *[]string `json:"non_persistent_attrs,omitempty"`
705708
}
706709

710+
type ConnectionOptionsGoogleApps struct {
711+
ClientID *string `json:"client_id,omitempty"`
712+
ClientSecret *string `json:"client_secret,omitempty"`
713+
Domain *string `json:"domain,omitempty"`
714+
715+
EnableUsersAPI *bool `json:"api_enable_users,omitempty"`
716+
BasicProfile *bool `json:"basic_profile,omitempty" scope:"basic_profile"`
717+
ExtendedProfile *bool `json:"ext_profile,omitempty" scope:"ext_profile"`
718+
Groups *bool `json:"ext_groups,omitempty" scope:"ext_groups"`
719+
Admin *bool `json:"ext_admin,omitempty" scope:"ext_admin"`
720+
IsSuspended *bool `json:"ext_is_suspended,omitempty" scope:"ext_is_suspended"`
721+
AgreedTerms *bool `json:"ext_agreed_terms,omitempty" scope:"ext_agreed_terms"`
722+
723+
SetUserAttributes *string `json:"set_user_root_attributes,omitempty"`
724+
NonPersistentAttrs *[]string `json:"non_persistent_attrs,omitempty"`
725+
726+
DomainAliases []interface{} `json:"domain_aliases,omitempty"`
727+
LogoURL *string `json:"icon_url,omitempty"`
728+
}
729+
707730
type ConnectionManager struct {
708731
*Management
709732
}

management/connection_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package management
22

33
import (
4-
"github.com/stretchr/testify/assert"
54
"log"
65
"testing"
76
"time"
87

8+
"github.com/stretchr/testify/assert"
9+
910
"gopkg.in/auth0.v5"
1011
"gopkg.in/auth0.v5/internal/testing/expect"
1112
)
@@ -77,6 +78,8 @@ func TestConnection(t *testing.T) {
7778
_, ok = c.Options.(*ConnectionOptionsAzureAD)
7879
case ConnectionStrategySAML:
7980
_, ok = c.Options.(*ConnectionOptionsSAML)
81+
case ConnectionStrategyGoogleApps:
82+
_, ok = c.Options.(*ConnectionOptionsGoogleApps)
8083
default:
8184
_, ok = c.Options.(map[string]interface{})
8285
}

management/management.gen.go

Lines changed: 109 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)