Merge branch 'main' into feat/issue#574

This commit is contained in:
Tim Möhlmann 2024-04-16 11:40:30 +03:00 committed by GitHub
commit 05530902fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 8 deletions

View file

@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: add issue - name: add issue
uses: actions/add-to-project@v1.0.0 uses: actions/add-to-project@v1.0.1
if: ${{ github.event_name == 'issues' }} if: ${{ github.event_name == 'issues' }}
with: with:
# You can target a repository in a different organization # You can target a repository in a different organization
@ -28,7 +28,7 @@ jobs:
username: ${{ github.actor }} username: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }} GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}
- name: add pr - name: add pr
uses: actions/add-to-project@v1.0.0 uses: actions/add-to-project@v1.0.1
if: ${{ github.event_name == 'pull_request_target' && github.actor != 'dependabot[bot]' && !contains(steps.checkUserMember.outputs.teams, 'engineers')}} if: ${{ github.event_name == 'pull_request_target' && github.actor != 'dependabot[bot]' && !contains(steps.checkUserMember.outputs.teams, 'engineers')}}
with: with:
# You can target a repository in a different organization # You can target a repository in a different organization

View file

@ -27,7 +27,7 @@ jobs:
with: with:
go-version: ${{ matrix.go }} go-version: ${{ matrix.go }}
- run: go test -race -v -coverprofile=profile.cov -coverpkg=./pkg/... ./pkg/... - run: go test -race -v -coverprofile=profile.cov -coverpkg=./pkg/... ./pkg/...
- uses: codecov/codecov-action@v4.2.0 - uses: codecov/codecov-action@v4.3.0
with: with:
file: ./profile.cov file: ./profile.cov
name: codecov-go name: codecov-go

View file

@ -56,7 +56,7 @@ func SetupServer(issuer string, storage Storage, logger *slog.Logger, wrapServer
// for simplicity, we provide a very small default page for users who have signed out // for simplicity, we provide a very small default page for users who have signed out
router.HandleFunc(pathLoggedOut, func(w http.ResponseWriter, req *http.Request) { router.HandleFunc(pathLoggedOut, func(w http.ResponseWriter, req *http.Request) {
w.Write([]byte("signed out successfully")) w.Write([]byte("signed out successfully"))
// no need to check/log error, this will be handeled by the middleware. // no need to check/log error, this will be handled by the middleware.
}) })
// creation of the OpenIDProvider with the just created in-memory Storage // creation of the OpenIDProvider with the just created in-memory Storage

View file

@ -60,7 +60,7 @@ type RelyingParty interface {
// UserinfoEndpoint returns the userinfo // UserinfoEndpoint returns the userinfo
UserinfoEndpoint() string UserinfoEndpoint() string
// GetDeviceAuthorizationEndpoint returns the enpoint which can // GetDeviceAuthorizationEndpoint returns the endpoint which can
// be used to start a DeviceAuthorization flow. // be used to start a DeviceAuthorization flow.
GetDeviceAuthorizationEndpoint() string GetDeviceAuthorizationEndpoint() string
@ -401,7 +401,7 @@ func AuthURL(state string, rp RelyingParty, opts ...AuthURLOpt) string {
// AuthURLHandler extends the `AuthURL` method with a http redirect handler // AuthURLHandler extends the `AuthURL` method with a http redirect handler
// including handling setting cookie for secure `state` transfer. // including handling setting cookie for secure `state` transfer.
// Custom paramaters can optionally be set to the redirect URL. // Custom parameters can optionally be set to the redirect URL.
func AuthURLHandler(stateFn func() string, rp RelyingParty, urlParam ...URLParamOpt) http.HandlerFunc { func AuthURLHandler(stateFn func() string, rp RelyingParty, urlParam ...URLParamOpt) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) {
opts := make([]AuthURLOpt, len(urlParam)) opts := make([]AuthURLOpt, len(urlParam))
@ -655,7 +655,7 @@ func GetEndpoints(discoveryConfig *oidc.DiscoveryConfiguration) Endpoints {
} }
} }
// withURLParam sets custom url paramaters. // withURLParam sets custom url parameters.
// This is the generalized, unexported, function used by both // This is the generalized, unexported, function used by both
// URLParamOpt and AuthURLOpt. // URLParamOpt and AuthURLOpt.
func withURLParam(key, value string) func() []oauth2.AuthCodeOption { func withURLParam(key, value string) func() []oauth2.AuthCodeOption {
@ -747,7 +747,7 @@ type RefreshTokenRequest struct {
// the old one should be considered invalid. // the old one should be considered invalid.
// //
// In case the RP is not OAuth2 only and an IDToken was part of the response, // In case the RP is not OAuth2 only and an IDToken was part of the response,
// the IDToken and AccessToken will be verfied // the IDToken and AccessToken will be verified
// and the IDToken and IDTokenClaims fields will be populated in the returned object. // and the IDToken and IDTokenClaims fields will be populated in the returned object.
func RefreshTokens[C oidc.IDClaims](ctx context.Context, rp RelyingParty, refreshToken, clientAssertion, clientAssertionType string) (*oidc.Tokens[C], error) { func RefreshTokens[C oidc.IDClaims](ctx context.Context, rp RelyingParty, refreshToken, clientAssertion, clientAssertionType string) (*oidc.Tokens[C], error) {
ctx, span := client.Tracer.Start(ctx, "RefreshTokens") ctx, span := client.Tracer.Start(ctx, "RefreshTokens")