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

mindersec / minder / 25342198270

04 May 2026 08:36PM UTC coverage: 60.442% (+2.1%) from 58.3%
25342198270

Pull #6253

github

web-flow
Merge 537c7f40e into 1347d06af
Pull Request #6253: Update roadmap for 2026 (and possibly beyond)

20396 of 33745 relevant lines covered (60.44%)

38.95 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
)
12

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

29
        return id.UserID, nil
×
30
}
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