Skip to content

Commit

Permalink
Update error message on GitHub OSS (#32818)
Browse files Browse the repository at this point in the history
* Update error message on GitHub OSS

* add specific error message variable for github

* update code comments

Co-authored-by: Zac Bergquist <[email protected]>

* update error message

* keep error message format

* update language

Co-authored-by: rosstimothy <[email protected]>

* update comment

Co-authored-by: rosstimothy <[email protected]>

---------

Co-authored-by: Zac Bergquist <[email protected]>
Co-authored-by: rosstimothy <[email protected]>
  • Loading branch information
3 people authored Oct 3, 2023
1 parent c1a994c commit 47f2bb2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/services/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package services

import (
"encoding/json"
"fmt"
"sync"

"github.com/gravitational/trace"
Expand All @@ -26,6 +27,8 @@ import (
"github.com/gravitational/teleport/lib/utils"
)

// ErrRequiresEnterprise indicates that a feature requires
// Teleport Enterprise.
var ErrRequiresEnterprise = &trace.AccessDeniedError{Message: "this feature requires Teleport Enterprise"}

// githubConnectorMutex is a mutex for the GitHub auth connector
Expand Down Expand Up @@ -174,7 +177,7 @@ func MarshalOSSGithubConnector(githubConnector types.GithubConnector, opts ...Ma
switch githubConnector := githubConnector.(type) {
case *types.GithubConnectorV3:
if githubConnector.Spec.EndpointURL != "" {
return nil, trace.Wrap(ErrRequiresEnterprise)
return nil, fmt.Errorf("GitHub endpoint URL is set: %w", ErrRequiresEnterprise)
}

if !cfg.PreserveResourceID {
Expand Down

0 comments on commit 47f2bb2

Please sign in to comment.