-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(RELTEC-12197): remove user validation to increase startup time, …
…validation should be done by upstream services
- Loading branch information
Knupfer, Raffael
committed
Feb 13, 2025
1 parent
855a7ef
commit 0cc3c05
Showing
10 changed files
with
4 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,11 @@ | ||
package githubclient | ||
|
||
import ( | ||
"fmt" | ||
"github.com/Interhyp/metadata-service/internal/acorn/config" | ||
"github.com/google/go-github/v66/github" | ||
"net/http" | ||
"regexp" | ||
) | ||
|
||
func NewClient(client *http.Client, accessToken string, customConfig config.CustomConfiguration) (*github.Client, error) { | ||
matcher := regexp.MustCompile(fmt.Sprintf("/users/[a-z_-]*%s", customConfig.UserPrefix())) | ||
cacheClient := NewCaching( | ||
client, | ||
func(method string, url string, requestBody interface{}) bool { | ||
return method == http.MethodGet && matcher.MatchString(url) | ||
}, | ||
).Client() | ||
return github.NewClient(cacheClient).WithAuthToken(accessToken), nil | ||
return github.NewClient(client).WithAuthToken(accessToken), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters