mirror of https://github.com/harness/drone.git
[CODE-617]: Update variable name and merge with main
parent
8f2c1d93ef
commit
084443f81e
|
@ -1,4 +1,4 @@
|
||||||
GITNESS_TRACE=true
|
GITNESS_TRACE=true
|
||||||
GITNESS_WEBHOOK_ALLOW_LOOPBACK=true
|
GITNESS_WEBHOOK_ALLOW_LOOPBACK=true
|
||||||
GITNESS_PRINCIPAL_ADMIN_PASSWORD=changeit
|
GITNESS_PRINCIPAL_ADMIN_PASSWORD=changeit
|
||||||
GITNESS_ALLOW_SIGNUP=true
|
GITNESS_ALLOW_SIGN_UP=true
|
|
@ -35,7 +35,7 @@ func (c *registerCommand) run(*kingpin.ParseContext) error {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
|
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
input := &user.RegisterInput{
|
input := &user.CreateInput{
|
||||||
UID: uid,
|
UID: uid,
|
||||||
Email: email,
|
Email: email,
|
||||||
DisplayName: displayName,
|
DisplayName: displayName,
|
||||||
|
|
|
@ -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.
|
// 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)
|
out := new(types.TokenResponse)
|
||||||
uri := fmt.Sprintf("%s/api/v1/register", c.base)
|
uri := fmt.Sprintf("%s/api/v1/register", c.base)
|
||||||
err := c.post(ctx, uri, true, input, out)
|
err := c.post(ctx, uri, true, input, out)
|
||||||
|
|
|
@ -17,7 +17,7 @@ type Client interface {
|
||||||
Login(ctx context.Context, input *user.LoginInput) (*types.TokenResponse, error)
|
Login(ctx context.Context, input *user.LoginInput) (*types.TokenResponse, error)
|
||||||
|
|
||||||
// Register registers a new user and returns a JWT token.
|
// 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 returns the currently authenticated user.
|
||||||
Self(ctx context.Context) (*types.User, error)
|
Self(ctx context.Context) (*types.User, error)
|
||||||
|
|
|
@ -24,7 +24,7 @@ func NewController(principalStore store.PrincipalStore, config *types.Config) *C
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Controller) IsUserRegistrationAllowed(ctx context.Context) (bool, error) {
|
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 {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ func (mr *MockClientMockRecorder) Login(arg0, arg1 interface{}) *gomock.Call {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register mocks base method.
|
// 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()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "Register", arg0, arg1)
|
ret := m.ctrl.Call(m, "Register", arg0, arg1)
|
||||||
ret0, _ := ret[0].(*types.TokenResponse)
|
ret0, _ := ret[0].(*types.TokenResponse)
|
||||||
|
|
|
@ -18,7 +18,7 @@ type Config struct {
|
||||||
// 5min should be enough for most git clones to complete.
|
// 5min should be enough for most git clones to complete.
|
||||||
GracefulShutdownTime time.Duration `envconfig:"GITNESS_GRACEFUL_SHUTDOWN_TIME" default:"300s"`
|
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 {
|
Profiler struct {
|
||||||
Type string `envconfig:"GITNESS_PROFILER_TYPE"`
|
Type string `envconfig:"GITNESS_PROFILER_TYPE"`
|
||||||
|
|
Loading…
Reference in New Issue