Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deps #57

Merged
merged 2 commits into from
Aug 21, 2020
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apigee/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package apigee

// Application represets an Apigee App
type Application struct {
AppID string `json:"appId"`
Attributes interface{} `json:"attributes,omitempty"`
Expand All @@ -27,14 +28,17 @@ type Application struct {
Status string `json:"status,omitempty"`
}

// Credential is a collection of APIProducts
type Credential struct {
APIProducts []APIProductRef `json:"apiProducts,omitempty"`
}

// AppResponse is a collection of Applications
type AppResponse struct {
Apps []Application `json:"app,omitempty"`
}

// APIProductRef holds the name and status of an APIProduct
type APIProductRef struct {
Name string `json:"apiproduct"`
Status string `json:"status,omitempty"`
Expand Down
6 changes: 4 additions & 2 deletions apigee/edge_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const (
octetStream = "application/octet-stream"
)

// OAuthURL is the oauth token endpoint
var OAuthURL = "https://login.apigee.com/oauth/token"

// EdgeClient manages communication with Apigee Edge V1 Admin API.
Expand Down Expand Up @@ -294,9 +295,8 @@ func (c *EdgeClient) getOAuthToken() error {
var errorResponse *ErrorResponse
if errors.As(err, &errorResponse) {
return fmt.Errorf("%d %v", res.StatusCode, errorResponse.Message)
} else {
return fmt.Errorf("%d", res.StatusCode)
}
return fmt.Errorf("%d", res.StatusCode)
}
body := &OAuthResponse{}
if err := json.NewDecoder(res.Body).Decode(body); err != nil {
Expand Down Expand Up @@ -496,10 +496,12 @@ func StreamToString(stream io.Reader) string {
return buf.String()
}

// SetOAuthURL sets the OAuth url
func SetOAuthURL(url string) {
OAuthURL = url
}

// OAuthResponse represents the response from the token request
type OAuthResponse struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
Expand Down
4 changes: 2 additions & 2 deletions cmd/bindings/bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,8 @@ func (b *bindings) verify(p *product.APIProduct, appMap map[string][]App, printf
for _, app := range apps {
if !app.hasRemoteService {
return fmt.Errorf(" app %s associated with product %s is not associated with remote-service product", app.name, p.Name)
} else {
printf(" app %s associated with product %s is verified", app.name, p.Name)
}
printf(" app %s associated with product %s is verified", app.name, p.Name)
}
return nil
}
Expand Down Expand Up @@ -438,6 +437,7 @@ func (a byName) Len() int { return len(a) }
func (a byName) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a byName) Less(i, j int) bool { return a[i].Name < a[j].Name }

// App represents an Apigee App
type App struct {
name string
hasRemoteService bool
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
module github.com/apigee/apigee-remote-service-cli

go 1.14
go 1.15

// replace github.com/apigee/apigee-remote-service-golib => ../apigee-remote-service-golib

// replace github.com/apigee/apigee-remote-service-envoy => ../apigee-remote-service-envoy

require (
github.com/apigee/apigee-remote-service-envoy v1.0.1-0.20200804175757-cbe957d201e9
github.com/apigee/apigee-remote-service-golib v1.0.1-0.20200804164710-3c3cefe945df
github.com/apigee/apigee-remote-service-envoy v1.1.0-rc.1
github.com/apigee/apigee-remote-service-golib v1.1.0-rc.1
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d
github.com/lestrrat-go/jwx v1.0.3
github.com/lestrrat-go/jwx v1.0.4
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.0.0
go.uber.org/multierr v1.5.0
Expand Down
Loading