@@ -125,32 +125,48 @@ func TestScope(t *testing.T) {
125125
126126 testCases := []struct {
127127 name string
128+ configuredType options.ProviderType
128129 configuredScope string
129130 expectedScope string
130131 allowedGroups []string
131132 }{
132133 {
133− name: "with no scope provided",
134+ name: "oidc: with no scope provided",
135+ configuredType: "oidc",
134136 configuredScope: "",
135137 expectedScope: "openid email profile",
136138 },
137139 {
138− name: "with no scope provided and groups",
140+ name: "oidc: with no scope provided and groups",
141+ configuredType: "oidc",
139142 configuredScope: "",
140143 expectedScope: "openid email profile groups",
141144 allowedGroups: []string{"foo"},
142145 },
143146 {
144− name: "with a configured scope provided",
147+ name: "oidc: with a configured scope provided",
148+ configuredType: "oidc",
145149 configuredScope: "openid",
146150 expectedScope: "openid",
147151 },
152+ {
153+ name: "github: with no scope provided",
154+ configuredType: "github",
155+ configuredScope: "",
156+ expectedScope: "user:email",
157+ },
158+ {
159+ name: "github: with a configured scope provided",
160+ configuredType: "github",
161+ configuredScope: "user:email org:read",
162+ expectedScope: "user:email org:read",
163+ },
148164 }
149165
150166 for _, tc := range testCases {
151167 providerConfig := options.Provider{
152168 ID: providerID,
153− Type: "oidc",
169+ Type: tc.configuredType,
154170 ClientID: clientID,
155171 ClientSecretFile: clientSecret,
156172 LoginURL: msAuthURL,
@@ -164,10 +180,10 @@ func TestScope(t *testing.T) {
164180 },
165181 }
166182
167− pd, err := newProviderDataFromConfig(providerConfig)
183+ pd, err := NewProvider(providerConfig)
168184 g.Expect(err).ToNot(HaveOccurred())
169185
170− g.Expect(pd.Scope).To(Equal(tc.expectedScope))
186+ g.Expect(pd.Data().Scope).To(Equal(tc.expectedScope))
171187 }
172188}
173189