-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move information request to checkup
- Loading branch information
Showing
15 changed files
with
165 additions
and
73 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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package config | ||
|
||
type WorkerConfig struct { | ||
DoTelemetry bool `yaml:"do_telemetry"` | ||
TelemetryWorkspaceID string `yaml:"telemetry_workspace_id"` | ||
TelemetryHostname string `yaml:"telemetry_hostname"` | ||
TelemetryBaseURL string `yaml:"telemetry_base_url"` | ||
} |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package client | ||
|
||
import ( | ||
"fmt" | ||
"github.com/labstack/echo/v4" | ||
"github.com/opengovern/og-util/pkg/httpclient" | ||
"github.com/opengovern/opengovernance/services/auth/api" | ||
"net/http" | ||
) | ||
|
||
type AuthServiceClient interface { | ||
ListUsers(ctx *httpclient.Context) ([]api.GetUsersResponse, error) | ||
} | ||
|
||
type authClient struct { | ||
baseURL string | ||
} | ||
|
||
func NewAuthClient(baseURL string) AuthServiceClient { | ||
return &authClient{baseURL: baseURL} | ||
} | ||
|
||
func (s *authClient) ListUsers(ctx *httpclient.Context) ([]api.GetUsersResponse, error) { | ||
url := fmt.Sprintf("%s/api/v1/users", s.baseURL) | ||
|
||
var users []api.GetUsersResponse | ||
if statusCode, err := httpclient.DoRequest(ctx.Ctx, http.MethodGet, url, ctx.ToHeaders(), nil, &users); err != nil { | ||
if 400 <= statusCode && statusCode < 500 { | ||
return nil, echo.NewHTTPError(statusCode, err.Error()) | ||
} | ||
return nil, err | ||
} | ||
return users, 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
Oops, something went wrong.