• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mindersec / minder / 23955099094

03 Apr 2026 05:18PM UTC coverage: 58.279% (-0.04%) from 58.315%
23955099094

Pull #6265

github

web-flow
Merge 0a057761a into 1760b5d40
Pull Request #6265: Generalize identity provider and implement OIDC discovery

20 of 122 new or added lines in 10 files covered. (16.39%)

2 existing lines in 1 file now uncovered.

19214 of 32969 relevant lines covered (58.28%)

36.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/internal/auth/github.go
1
// SPDX-FileCopyrightText: Copyright 2023 The Minder Authors
2
// SPDX-License-Identifier: Apache-2.0
3

4
// Package auth contains the authentication logic for the control plane
5
package auth
6

7
import (
8
        "context"
9
        "errors"
10
        "fmt"
11
        "strings"
12
)
13

14
// GetUserForGitHubId looks up a user in the identity provider by their GitHub ID.
15
//
16
// If the user is found, it returns their subject suitable for use in
17
// the `sub` claim of a JWT, and in OpenFGA's user field. Note that this function may
18
// return a user of "" with no error if no users were found matching the GitHub ID.
NEW
19
func GetUserForGitHubId(ctx context.Context, idClient Resolver, ghUser int64) (string, error) {
×
NEW
20
        // look up the user in the identity provider
×
NEW
21
        id, err := idClient.Resolve(ctx, fmt.Sprintf("%d", ghUser))
×
22
        if err != nil {
×
NEW
23
                // If the user is not found, return an empty string and no error
×
NEW
24
                if errors.Is(err, errors.New("user not found in identity store")) || strings.Contains(err.Error(), "not found") {
×
NEW
25
                        return "", nil
×
NEW
26
                }
×
27
                return "", err
×
28
        }
29

NEW
30
        return id.UserID, nil
×
31
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc