[CODE-617]: Update variable name and merge with main

jobatzil/rename
Akhilesh Pandey 2023-08-01 18:53:01 +05:30
parent 8f2c1d93ef
commit 084443f81e
7 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
GITNESS_TRACE=true
GITNESS_WEBHOOK_ALLOW_LOOPBACK=true
GITNESS_PRINCIPAL_ADMIN_PASSWORD=changeit
GITNESS_ALLOW_SIGNUP=true
GITNESS_ALLOW_SIGN_UP=true

View File

@ -35,7 +35,7 @@ func (c *registerCommand) run(*kingpin.ParseContext) error {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
input := &user.RegisterInput{
input := &user.CreateInput{
UID: uid,
Email: email,
DisplayName: displayName,

View File

@ -67,7 +67,7 @@ func (c *HTTPClient) Login(ctx context.Context, input *user.LoginInput) (*types.
}
// Register registers a new user and returns a JWT token.
func (c *HTTPClient) Register(ctx context.Context, input *user.RegisterInput) (*types.TokenResponse, error) {
func (c *HTTPClient) Register(ctx context.Context, input *user.CreateInput) (*types.TokenResponse, error) {
out := new(types.TokenResponse)
uri := fmt.Sprintf("%s/api/v1/register", c.base)
err := c.post(ctx, uri, true, input, out)

View File

@ -17,7 +17,7 @@ type Client interface {
Login(ctx context.Context, input *user.LoginInput) (*types.TokenResponse, error)
// Register registers a new user and returns a JWT token.
Register(ctx context.Context, input *user.RegisterInput) (*types.TokenResponse, error)
Register(ctx context.Context, input *user.CreateInput) (*types.TokenResponse, error)
// Self returns the currently authenticated user.
Self(ctx context.Context) (*types.User, error)

View File

@ -24,7 +24,7 @@ func NewController(principalStore store.PrincipalStore, config *types.Config) *C
}
func (c *Controller) IsUserRegistrationAllowed(ctx context.Context) (bool, error) {
usrCount, err := c.principalStore.CountUsers(ctx)
usrCount, err := c.principalStore.CountUsers(ctx, &types.UserFilter{})
if err != nil {
return false, err
}

View File

@ -52,7 +52,7 @@ func (mr *MockClientMockRecorder) Login(arg0, arg1 interface{}) *gomock.Call {
}
// Register mocks base method.
func (m *MockClient) Register(arg0 context.Context, arg1 *user.RegisterInput) (*types.TokenResponse, error) {
func (m *MockClient) Register(arg0 context.Context, arg1 *user.CreateInput) (*types.TokenResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Register", arg0, arg1)
ret0, _ := ret[0].(*types.TokenResponse)

View File

@ -12,13 +12,13 @@ import (
type Config struct {
// InstanceID specifis the ID of the gitness instance.
// NOTE: If the value is not provided the hostname of the machine is used.
InstanceID string `envconfig:"GITNESS_INSTANCE_ID"`
Debug bool `envconfig:"GITNESS_DEBUG"`
Trace bool `envconfig:"GITNESS_TRACE"`// GracefulShutdownTime defines the max time we wait when shutting down a server.
InstanceID string `envconfig:"GITNESS_INSTANCE_ID"`
Debug bool `envconfig:"GITNESS_DEBUG"`
Trace bool `envconfig:"GITNESS_TRACE"` // GracefulShutdownTime defines the max time we wait when shutting down a server.
// 5min should be enough for most git clones to complete.
GracefulShutdownTime time.Duration `envconfig:"GITNESS_GRACEFUL_SHUTDOWN_TIME" default:"300s"`
AllowSignUp bool `envconfig:"GITNESS_ALLOW_SIGNUP"`
AllowSignUp bool `envconfig:"GITNESS_ALLOW_SIGN_UP"`
Profiler struct {
Type string `envconfig:"GITNESS_PROFILER_TYPE"`