Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit97afe11

Browse files
committed
typos
1 parent1d9abdf commit97afe11

File tree

2 files changed

+19
-24
lines changed

2 files changed

+19
-24
lines changed

‎coderd/externalauth/externalauth.go‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929

3030
// Config is used for authentication for Git operations.
3131
typeConfigstruct {
32-
promoauth.InstrumentedeOAuth2Config
32+
promoauth.InstrumentedOAuth2Config
3333
// ID is a unique identifier for the authenticator.
3434
IDstring
3535
// Type is the type of provider.
@@ -188,7 +188,7 @@ func (c *Config) ValidateToken(ctx context.Context, token string) (bool, *coders
188188
}
189189

190190
req.Header.Set("Authorization",fmt.Sprintf("Bearer %s",token))
191-
res,err:=c.InstrumentedeOAuth2Config.Do(ctx,"ValidateToken",req)
191+
res,err:=c.InstrumentedOAuth2Config.Do(ctx,"ValidateToken",req)
192192
iferr!=nil {
193193
returnfalse,nil,err
194194
}
@@ -238,7 +238,7 @@ func (c *Config) AppInstallations(ctx context.Context, token string) ([]codersdk
238238
returnnil,false,err
239239
}
240240
req.Header.Set("Authorization",fmt.Sprintf("Bearer %s",token))
241-
res,err:=c.InstrumentedeOAuth2Config.Do(ctx,"AppInstallations",req)
241+
res,err:=c.InstrumentedOAuth2Config.Do(ctx,"AppInstallations",req)
242242
iferr!=nil {
243243
returnnil,false,err
244244
}
@@ -279,7 +279,7 @@ func (c *Config) AppInstallations(ctx context.Context, token string) ([]codersdk
279279

280280
typeDeviceAuthstruct {
281281
// Cfg is provided for the http client method.
282-
Cfg promoauth.InstrumentedeOAuth2Config
282+
Cfg promoauth.InstrumentedOAuth2Config
283283
ClientIDstring
284284
TokenURLstring
285285
Scopes []string
@@ -456,17 +456,17 @@ func ConvertConfig(instrument *promoauth.Factory, entries []codersdk.ExternalAut
456456
}
457457

458458
cfg:=&Config{
459-
InstrumentedeOAuth2Config:instrument.New(entry.ID,oauthConfig),
460-
ID:entry.ID,
461-
Regex:regex,
462-
Type:entry.Type,
463-
NoRefresh:entry.NoRefresh,
464-
ValidateURL:entry.ValidateURL,
465-
AppInstallationsURL:entry.AppInstallationsURL,
466-
AppInstallURL:entry.AppInstallURL,
467-
DisplayName:entry.DisplayName,
468-
DisplayIcon:entry.DisplayIcon,
469-
ExtraTokenKeys:entry.ExtraTokenKeys,
459+
InstrumentedOAuth2Config:instrument.New(entry.ID,oauthConfig),
460+
ID:entry.ID,
461+
Regex:regex,
462+
Type:entry.Type,
463+
NoRefresh:entry.NoRefresh,
464+
ValidateURL:entry.ValidateURL,
465+
AppInstallationsURL:entry.AppInstallationsURL,
466+
AppInstallURL:entry.AppInstallURL,
467+
DisplayName:entry.DisplayName,
468+
DisplayIcon:entry.DisplayIcon,
469+
ExtraTokenKeys:entry.ExtraTokenKeys,
470470
}
471471

472472
ifentry.DeviceFlow {

‎coderd/promoauth/oauth2.go‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ type OAuth2Config interface {
1818
TokenSource(context.Context,*oauth2.Token) oauth2.TokenSource
1919
}
2020

21-
typeInstrumentedeOAuth2Configinterface {
21+
// InstrumentedOAuth2Config extends OAuth2Config with a `Do` method that allows
22+
// external oauth related calls to be instrumented. This is to support
23+
// "ValidateToken" which is not an oauth2 specified method.
24+
typeInstrumentedOAuth2Configinterface {
2225
OAuth2Config
2326

2427
// Do is provided as a convience method to make a request with the oauth2 client.
@@ -28,14 +31,6 @@ type InstrumentedeOAuth2Config interface {
2831
Do(ctx context.Context,sourcestring,req*http.Request) (*http.Response,error)
2932
}
3033

31-
typeHTTPDointerface {
32-
// Do is provided as a convience method to make a request with the oauth2 client.
33-
// It mirrors `http.Client.Do`.
34-
// We need this because Coder adds some extra functionality to
35-
// oauth clients such as the `ValidateToken()` method.
36-
Do(ctx context.Context,sourcestring,req*http.Request) (*http.Response,error)
37-
}
38-
3934
var_OAuth2Config= (*Config)(nil)
4035

4136
typeFactorystruct {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp