MCPcopy Index your code
hub / github.com/coder/coder / generateApps

Function generateApps

coderd/oauth2_test.go:865–889  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T, client *codersdk.Client, suffix string)

Source from the content-addressed store, hash-verified

863}
864
865func generateApps(ctx context.Context, t *testing.T, client *codersdk.Client, suffix string) provisionedApps {
866 create := func(name, callback string) codersdk.OAuth2ProviderApp {
867 name = fmt.Sprintf("%s-%s", name, suffix)
868 //nolint:gocritic // OAauth2 app management requires owner permission.
869 app, err := client.PostOAuth2ProviderApp(ctx, codersdk.PostOAuth2ProviderAppRequest{
870 Name: name,
871 CallbackURL: callback,
872 Icon: "",
873 })
874 require.NoError(t, err)
875 require.Equal(t, name, app.Name)
876 require.Equal(t, callback, app.CallbackURL)
877 return app
878 }
879
880 return provisionedApps{
881 Default: create("app-a", "http://localhost1:8080/foo/bar"),
882 NoPort: create("app-b", "http://localhost2"),
883 Subdomain: create("app-z", "http://30.localhost:3000"),
884 Extra: []codersdk.OAuth2ProviderApp{
885 create("app-x", "http://20.localhost:3000"),
886 create("app-y", "http://10.localhost:3000"),
887 },
888 }
889}
890
891// generatePKCE creates a PKCE verifier and S256 challenge for testing.
892func generatePKCE() (verifier, challenge string) {

Calls 3

createFunction · 0.85
PostOAuth2ProviderAppMethod · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected