Skip to content

Commit

Permalink
Fix URL (#109)
Browse files Browse the repository at this point in the history
* Fix URL

* Use new sdk version

---------

Co-authored-by: michael burton <michaelburton@michaels-MacBook-Pro.local>
  • Loading branch information
mstanbCO and michael burton authored Nov 8, 2024
1 parent 4c4a5b4 commit c8dd69a
Show file tree
Hide file tree
Showing 83 changed files with 2,943 additions and 2,712 deletions.
2 changes: 1 addition & 1 deletion 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.2.35
github.com/conductorone/conductorone-sdk-go v1.21.1-0.20241009214436-e388bb33c02f
github.com/conductorone/conductorone-sdk-go v1.22.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 @@ -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.2.35 h1:aSdNvlM5HMti8WdhotrXTHWs+b+BmSqMxtGwsSUFxjY=
github.com/conductorone/baton-sdk v0.2.35/go.mod h1:hmd/Oz3DPIKD+9QmkusZaA18ZoiinnTDdrxh2skcdUc=
github.com/conductorone/conductorone-sdk-go v1.21.1-0.20241009214436-e388bb33c02f h1:8MMCnUzTwJegLhF/2XIP3ln+hjrEpWWX8YehtMg+m2k=
github.com/conductorone/conductorone-sdk-go v1.21.1-0.20241009214436-e388bb33c02f/go.mod h1:vr3946WqFYEpOuIGy/TqXkarhhCzHSKsmXXsxCmeIj8=
github.com/conductorone/conductorone-sdk-go v1.22.0 h1:sz9nz/85YZ0pJ/U3b63QEzE3WMSz6HuCjRTi/kb3mbU=
github.com/conductorone/conductorone-sdk-go v1.22.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.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
Expand Down
8 changes: 7 additions & 1 deletion 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 @@ -12,7 +12,6 @@ import (
"github.com/conductorone/conductorone-sdk-go/pkg/models/sdkerrors"
"github.com/conductorone/conductorone-sdk-go/pkg/models/shared"
"github.com/conductorone/conductorone-sdk-go/pkg/utils"
"io"
"net/http"
)

Expand Down Expand Up @@ -173,21 +172,11 @@ func (s *AppAccessRequestsDefaults) CancelAppAccessRequestsDefaults(ctx context.
RawResponse: httpRes,
}

getRawBody := func() ([]byte, error) {
rawBody, err := io.ReadAll(httpRes.Body)
if err != nil {
return nil, fmt.Errorf("error reading response body: %w", err)
}
httpRes.Body.Close()
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
return rawBody, nil
}

switch {
case httpRes.StatusCode == 200:
switch {
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
rawBody, err := getRawBody()
rawBody, err := utils.ConsumeRawBody(httpRes)
if err != nil {
return nil, err
}
Expand All @@ -199,28 +188,25 @@ func (s *AppAccessRequestsDefaults) CancelAppAccessRequestsDefaults(ctx context.

res.AppAccessRequestDefaults = &out
default:
rawBody, err := getRawBody()
rawBody, err := utils.ConsumeRawBody(httpRes)
if err != nil {
return nil, err
}

return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
}
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
fallthrough
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
rawBody, err := getRawBody()
rawBody, err := utils.ConsumeRawBody(httpRes)
if err != nil {
return nil, err
}

return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
default:
rawBody, err := getRawBody()
rawBody, err := utils.ConsumeRawBody(httpRes)
if err != nil {
return nil, err
}

return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
}

Expand Down Expand Up @@ -375,21 +361,11 @@ func (s *AppAccessRequestsDefaults) CreateAppAccessRequestsDefaults(ctx context.
RawResponse: httpRes,
}

getRawBody := func() ([]byte, error) {
rawBody, err := io.ReadAll(httpRes.Body)
if err != nil {
return nil, fmt.Errorf("error reading response body: %w", err)
}
httpRes.Body.Close()
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
return rawBody, nil
}

switch {
case httpRes.StatusCode == 200:
switch {
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
rawBody, err := getRawBody()
rawBody, err := utils.ConsumeRawBody(httpRes)
if err != nil {
return nil, err
}
Expand All @@ -401,28 +377,25 @@ func (s *AppAccessRequestsDefaults) CreateAppAccessRequestsDefaults(ctx context.

res.AppAccessRequestDefaults = &out
default:
rawBody, err := getRawBody()
rawBody, err := utils.ConsumeRawBody(httpRes)
if err != nil {
return nil, err
}

return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
}
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
fallthrough
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
rawBody, err := getRawBody()
rawBody, err := utils.ConsumeRawBody(httpRes)
if err != nil {
return nil, err
}

return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
default:
rawBody, err := getRawBody()
rawBody, err := utils.ConsumeRawBody(httpRes)
if err != nil {
return nil, err
}

return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
}

Expand Down Expand Up @@ -571,21 +544,11 @@ func (s *AppAccessRequestsDefaults) GetAppAccessRequestsDefaults(ctx context.Con
RawResponse: httpRes,
}

getRawBody := func() ([]byte, error) {
rawBody, err := io.ReadAll(httpRes.Body)
if err != nil {
return nil, fmt.Errorf("error reading response body: %w", err)
}
httpRes.Body.Close()
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
return rawBody, nil
}

switch {
case httpRes.StatusCode == 200:
switch {
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
rawBody, err := getRawBody()
rawBody, err := utils.ConsumeRawBody(httpRes)
if err != nil {
return nil, err
}
Expand All @@ -597,28 +560,25 @@ func (s *AppAccessRequestsDefaults) GetAppAccessRequestsDefaults(ctx context.Con

res.AppAccessRequestDefaults = &out
default:
rawBody, err := getRawBody()
rawBody, err := utils.ConsumeRawBody(httpRes)
if err != nil {
return nil, err
}

return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
}
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
fallthrough
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
rawBody, err := getRawBody()
rawBody, err := utils.ConsumeRawBody(httpRes)
if err != nil {
return nil, err
}

return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
default:
rawBody, err := getRawBody()
rawBody, err := utils.ConsumeRawBody(httpRes)
if err != nil {
return nil, err
}

return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
}

Expand Down
Loading

0 comments on commit c8dd69a

Please sign in to comment.