Skip to content

Commit

Permalink
Update conductorone-sdk-go to v1.21.0 (#104)
Browse files Browse the repository at this point in the history
* Update conductorone-sdk-go to v1.21.0

* Fixes goreleaser I think

* Fix lint
  • Loading branch information
loganintech authored Oct 2, 2024
1 parent 42fff3f commit 9e2dfd1
Show file tree
Hide file tree
Showing 39 changed files with 26 additions and 809 deletions.
1 change: 1 addition & 0 deletions .goreleaser.docker.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version: 2
project_name: cone
builds:
- binary: cone
Expand Down
7 changes: 3 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version: 2
project_name: cone
builds:
- binary: cone
Expand Down Expand Up @@ -83,15 +84,13 @@ checksum:
- glob: ./dist/*-darwin-amd64.zip
- glob: ./dist/*-darwin-arm64.zip
brews:
- tap:
owner: conductorone
name: homebrew-cone
folder: Formula
- name: homebrew-cone
homepage: https://conductorone.com
test: |
system "#{bin}/cone -v"
install: |-
bin.install "cone"
changelog:
filters:
exclude:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
)

require (
github.com/conductorone/conductorone-sdk-go v1.20.0
github.com/conductorone/conductorone-sdk-go v1.21.0
github.com/pterm/pterm v0.12.62
github.com/toqueteos/webbrowser v1.2.0
github.com/xhit/go-str2duration/v2 v2.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,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/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/conductorone/conductorone-sdk-go v1.20.0 h1:FEiBIGijVfoFMC0QrX/hhHMlJQleuLv1Ptg/5aMUilI=
github.com/conductorone/conductorone-sdk-go v1.20.0/go.mod h1:vr3946WqFYEpOuIGy/TqXkarhhCzHSKsmXXsxCmeIj8=
github.com/conductorone/conductorone-sdk-go v1.21.0 h1:HNf+RxeKPGPfgKzDdlB44mbdMy+OWnKLJNrJx/AYgK0=
github.com/conductorone/conductorone-sdk-go v1.21.0/go.mod h1:vr3946WqFYEpOuIGy/TqXkarhhCzHSKsmXXsxCmeIj8=
github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw=
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
Expand Down
7 changes: 4 additions & 3 deletions pkg/client/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (
"io"
"net/http"

"github.com/conductorone/cone/pkg/output"
"github.com/spf13/viper"

"github.com/conductorone/cone/pkg/output"
)

const defaultJSONError = `{"error": "unable to marshal error to JSON %s"}`
Expand Down Expand Up @@ -65,12 +66,12 @@ func HandleErrors(ctx context.Context, v *viper.Viper, input error) error {
if err != nil {
return fmt.Errorf(defaultJSONError, httpErr.Error())
}
return fmt.Errorf(string(jsonError))
return errors.New(string(jsonError))
}
jsonError, err := output.MakeJSONFromInterface(ctx, JSONError{Error: input.Error()}, outputType == output.JSONPretty)
if err != nil {
return fmt.Errorf(defaultJSONError, input.Error())
}

return fmt.Errorf(string(jsonError))
return errors.New(string(jsonError))
}
12 changes: 11 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 @@ -202,9 +202,9 @@ func New(opts ...SDKOption) *ConductoroneAPI {
sdkConfiguration: sdkConfiguration{
Language: "go",
OpenAPIDocVersion: "0.1.0-alpha",
SDKVersion: "1.20.0",
SDKVersion: "1.21.0",
GenVersion: "2.428.1",
UserAgent: "speakeasy-sdk/go 1.20.0 2.428.1 0.1.0-alpha github.com/conductorone/conductorone-sdk-go",
UserAgent: "speakeasy-sdk/go 1.21.0 2.428.1 0.1.0-alpha github.com/conductorone/conductorone-sdk-go",
ServerDefaults: []map[string]string{
{
"tenantDomain": "example",
Expand Down

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 @@ -3,8 +3,6 @@
package shared

import (
"encoding/json"
"fmt"
"github.com/conductorone/conductorone-sdk-go/pkg/utils"
"time"
)
Expand All @@ -21,23 +19,6 @@ const (
func (e IdentityMatching) ToPointer() *IdentityMatching {
return &e
}
func (e *IdentityMatching) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "APP_USER_IDENTITY_MATCHING_UNSPECIFIED":
fallthrough
case "APP_USER_IDENTITY_MATCHING_STRICT":
fallthrough
case "APP_USER_IDENTITY_MATCHING_DISPLAY_NAME":
*e = IdentityMatching(v)
return nil
default:
return fmt.Errorf("invalid value for IdentityMatching: %v", v)
}
}

// The App object provides all of the details for an app, as well as some configuration.
type App struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

package shared

import (
"encoding/json"
"fmt"
)

type DurationUnset struct {
}

Expand All @@ -26,31 +21,6 @@ const (
func (e State) ToPointer() *State {
return &e
}
func (e *State) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "APP_ACCESS_REQUEST_DEFAULTS_LAST_APPLY_STATE_UNSPECIFIED":
fallthrough
case "APP_ACCESS_REQUEST_DEFAULTS_LAST_APPLY_STATE_RUNNING":
fallthrough
case "APP_ACCESS_REQUEST_DEFAULTS_LAST_APPLY_STATE_SUCCESS":
fallthrough
case "APP_ACCESS_REQUEST_DEFAULTS_LAST_APPLY_STATE_FAILED":
fallthrough
case "APP_ACCESS_REQUEST_DEFAULTS_LAST_APPLY_STATE_CANCELING":
fallthrough
case "APP_ACCESS_REQUEST_DEFAULTS_LAST_APPLY_STATE_CANCEL_SUCCESS":
fallthrough
case "APP_ACCESS_REQUEST_DEFAULTS_LAST_APPLY_STATE_CANCEL_ERROR":
*e = State(v)
return nil
default:
return fmt.Errorf("invalid value for State: %v", v)
}
}

// The AppAccessRequestDefaults message.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
package shared

import (
"encoding/json"
"fmt"
"github.com/conductorone/conductorone-sdk-go/pkg/utils"
"time"
)
Expand All @@ -21,23 +19,6 @@ const (
func (e EventType) ToPointer() *EventType {
return &e
}
func (e *EventType) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "GRANT_EVENT_TYPE_UNSPECIFIED":
fallthrough
case "GRANT_EVENT_TYPE_ADDED":
fallthrough
case "GRANT_EVENT_TYPE_REMOVED":
*e = EventType(v)
return nil
default:
return fmt.Errorf("invalid value for EventType: %v", v)
}
}

// The AppEntitlementUserBindingFeed message.
type AppEntitlementUserBindingFeed struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
package shared

import (
"encoding/json"
"fmt"
"github.com/conductorone/conductorone-sdk-go/pkg/utils"
"time"
)
Expand All @@ -22,25 +20,6 @@ const (
func (e AppPopulationReportState) ToPointer() *AppPopulationReportState {
return &e
}
func (e *AppPopulationReportState) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "REPORT_STATE_UNSPECIFIED":
fallthrough
case "REPORT_STATE_PENDING":
fallthrough
case "REPORT_STATE_OK":
fallthrough
case "REPORT_STATE_ERROR":
*e = AppPopulationReportState(v)
return nil
default:
return fmt.Errorf("invalid value for AppPopulationReportState: %v", v)
}
}

// The AppPopulationReport is a generated report for a specific app that gives details about the app's users. These details include what groups, roles, and other entitlements the users have access to.
type AppPopulationReport struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

package shared

import (
"encoding/json"
"fmt"
)

// ApprovalInstanceState - The state of the approval instance
type ApprovalInstanceState string

Expand All @@ -21,27 +16,6 @@ const (
func (e ApprovalInstanceState) ToPointer() *ApprovalInstanceState {
return &e
}
func (e *ApprovalInstanceState) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "APPROVAL_INSTANCE_STATE_UNSPECIFIED":
fallthrough
case "APPROVAL_INSTANCE_STATE_INIT":
fallthrough
case "APPROVAL_INSTANCE_STATE_SENDING_NOTIFICATIONS":
fallthrough
case "APPROVAL_INSTANCE_STATE_WAITING":
fallthrough
case "APPROVAL_INSTANCE_STATE_DONE":
*e = ApprovalInstanceState(v)
return nil
default:
return fmt.Errorf("invalid value for ApprovalInstanceState: %v", v)
}
}

// ApprovalInstance - The approval instance object describes the way a policy step should be approved as well as its outcomes and state.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
package shared

import (
"encoding/json"
"fmt"
"github.com/conductorone/conductorone-sdk-go/pkg/utils"
"time"
)
Expand All @@ -22,25 +20,6 @@ const (
func (e AppUserType) ToPointer() *AppUserType {
return &e
}
func (e *AppUserType) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "APP_USER_TYPE_UNSPECIFIED":
fallthrough
case "APP_USER_TYPE_USER":
fallthrough
case "APP_USER_TYPE_SERVICE_ACCOUNT":
fallthrough
case "APP_USER_TYPE_SYSTEM_ACCOUNT":
*e = AppUserType(v)
return nil
default:
return fmt.Errorf("invalid value for AppUserType: %v", v)
}
}

// AppUser - Application User that represents an account in the application.
type AppUser struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

package shared

import (
"encoding/json"
"fmt"
)

// Status - The application user status field.
type Status string

Expand All @@ -20,25 +15,6 @@ const (
func (e Status) ToPointer() *Status {
return &e
}
func (e *Status) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "STATUS_UNSPECIFIED":
fallthrough
case "STATUS_ENABLED":
fallthrough
case "STATUS_DISABLED":
fallthrough
case "STATUS_DELETED":
*e = Status(v)
return nil
default:
return fmt.Errorf("invalid value for Status: %v", v)
}
}

// AppUserStatus - The satus of the applicaiton user.
type AppUserStatus struct {
Expand Down
Loading

0 comments on commit 9e2dfd1

Please sign in to comment.