Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions cmd/cone/form_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func collectFormFields(ctx context.Context, v *viper.Viper, form *shared.FormInp
}

// collectFieldValue collects a single field value from the user based on field type.
func collectFieldValue(ctx context.Context, field shared.Field, displayName, description string) (any, error) {
func collectFieldValue(ctx context.Context, field shared.FieldInput, displayName, description string) (any, error) {
// Check for default value first
if defaultValue := getFieldDefaultValue(field); defaultValue != nil {
// Show default value and ask for confirmation
Expand Down Expand Up @@ -235,7 +235,7 @@ func collectStringSliceField(ctx context.Context, field *shared.StringSliceField
}

// getFieldDefaultValue extracts the default value from a field based on its type.
func getFieldDefaultValue(field shared.Field) any {
func getFieldDefaultValue(field shared.FieldInput) any {
switch {
case field.StringField != nil && field.StringField.DefaultValue != nil:
return *field.StringField.DefaultValue
Expand Down Expand Up @@ -385,7 +385,7 @@ func (v Int64FieldValidator) Prompt(isFirstRun bool) {
}

// isFieldRequired checks if a field is required based on its validation rules.
func isFieldRequired(field shared.Field) bool {
func isFieldRequired(field shared.FieldInput) bool {
switch {
case field.StringField != nil:
rules := field.StringField.StringRules
Expand Down
18 changes: 13 additions & 5 deletions cmd/cone/get_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,16 @@ func (r *User) WideHeader() []string {
}

func (r *User) rows() []string {
var statusStr string
if r.Status != nil {
statusStr = userStatusToString[*r.Status]
} else {
statusStr = "Unknown"
}

return []string{
client.StringFromPtr(r.Email),
userStatusToString[*r.Status],
statusStr,
client.StringFromPtr(r.JobTitle),
client.StringFromPtr(r.Department),
client.StringFromPtr(r.EmploymentStatus),
Expand All @@ -82,8 +89,9 @@ func (r *User) Rows() [][]string {
return [][]string{r.rows()}
}

var userStatusToString = map[shared.UserStatus]string{
shared.UserStatusEnabled: "Enabled",
shared.UserStatusDisabled: "Disabled",
shared.UserStatusDeleted: "Deleted",
var userStatusToString = map[shared.UserSchemasStatus]string{
shared.UserSchemasStatusUnknown: "Unknown",
shared.UserSchemasStatusEnabled: "Enabled",
shared.UserSchemasStatusDisabled: "Disabled",
shared.UserSchemasStatusDeleted: "Deleted",
}
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (

require (
github.com/conductorone/baton-sdk v0.3.17
github.com/conductorone/conductorone-sdk-go v1.26.0
github.com/conductorone/conductorone-sdk-go v1.27.1
github.com/pterm/pterm v0.12.81
github.com/toqueteos/webbrowser v1.2.0
github.com/xhit/go-str2duration/v2 v2.1.0
Expand All @@ -26,7 +26,6 @@ require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/containerd/console v1.0.5 // indirect
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
github.com/ericlagergren/decimal v0.0.0-20240411145413-00de7ca16731 // indirect
github.com/go-jose/go-jose/v4 v4.1.1 // indirect
github.com/go-viper/mapstructure/v2 v2.3.0 // indirect
github.com/gookit/color v1.5.4 // indirect
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/conductorone/baton-sdk v0.3.17 h1:aJNr4T2xr7rDa4P2nwKEHjJngI5JcNgfBZZ9aeeliHc=
github.com/conductorone/baton-sdk v0.3.17/go.mod h1:lWZHgu025Rsgs5jvBrhilGti0zWF2+YfaFY/bWOS/g0=
github.com/conductorone/conductorone-sdk-go v1.26.0 h1:rttrr9oZTI3EijF9i/httTlQJVFEuPcDBCWYROim1M8=
github.com/conductorone/conductorone-sdk-go v1.26.0/go.mod h1:8rB6lh/HUjl0hode8Vhf4U9/bR+FyANEDffGG2JaLJY=
github.com/conductorone/conductorone-sdk-go v1.27.1 h1:qKiUR4uFDlNJmpNlJd4dDJsl7sFxfmaAO1p8xGDrTSg=
github.com/conductorone/conductorone-sdk-go v1.27.1/go.mod h1:XfnxsPIsLn6s01PD46kU9tEUUljTRik7aviJIwB7D0k=
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
github.com/containerd/console v1.0.5 h1:R0ymNeydRqH2DmakFNdmjR2k0t7UPuiOV/N/27/qqsc=
github.com/containerd/console v1.0.5/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk=
Expand All @@ -46,8 +46,6 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8=
github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU=
github.com/ericlagergren/decimal v0.0.0-20240411145413-00de7ca16731 h1:R/ZjJpjQKsZ6L/+Gf9WHbt31GG8NMVcpRqUE+1mMIyo=
github.com/ericlagergren/decimal v0.0.0-20240411145413-00de7ca16731/go.mod h1:M9R1FoZ3y//hwwnJtO51ypFGwm8ZfpxPT/ZLtO1mcgQ=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
Expand Down
71 changes: 64 additions & 7 deletions vendor/github.com/conductorone/conductorone-sdk-go/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 21 additions & 1 deletion vendor/github.com/conductorone/conductorone-sdk-go/RELEASES.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (s *AccessConflict) CreateMonitor(ctx context.Context, request *shared.Conf
BaseURL: baseURL,
Context: ctx,
OperationID: "c1.api.accessconflict.v1.AccessConflictService.CreateMonitor",
OAuth2Scopes: []string{},
OAuth2Scopes: nil,
SecuritySource: s.sdkConfiguration.Security,
}
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`)
Expand Down Expand Up @@ -275,7 +275,7 @@ func (s *AccessConflict) DeleteMonitor(ctx context.Context, request operations.C
BaseURL: baseURL,
Context: ctx,
OperationID: "c1.api.accessconflict.v1.AccessConflictService.DeleteMonitor",
OAuth2Scopes: []string{},
OAuth2Scopes: nil,
SecuritySource: s.sdkConfiguration.Security,
}
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "ConflictMonitorDeleteRequest", "json", `request:"mediaType=application/json"`)
Expand Down Expand Up @@ -487,7 +487,7 @@ func (s *AccessConflict) GetMonitor(ctx context.Context, request operations.C1AP
BaseURL: baseURL,
Context: ctx,
OperationID: "c1.api.accessconflict.v1.AccessConflictService.GetMonitor",
OAuth2Scopes: []string{},
OAuth2Scopes: nil,
SecuritySource: s.sdkConfiguration.Security,
}

Expand Down Expand Up @@ -692,7 +692,7 @@ func (s *AccessConflict) UpdateMonitor(ctx context.Context, request operations.C
BaseURL: baseURL,
Context: ctx,
OperationID: "c1.api.accessconflict.v1.AccessConflictService.UpdateMonitor",
OAuth2Scopes: []string{},
OAuth2Scopes: nil,
SecuritySource: s.sdkConfiguration.Security,
}
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "ConflictMonitorUpdateRequest", "json", `request:"mediaType=application/json"`)
Expand Down
Loading
Loading