MCPcopy Create free account
hub / github.com/goadesign/goa / Validate

Method Validate

expr/security.go:216–228  ·  view source on GitHub ↗

Validate ensures that TokenURL and AuthorizationURL are valid URLs.

()

Source from the content-addressed store, hash-verified

214
215// Validate ensures that TokenURL and AuthorizationURL are valid URLs.
216func (f *FlowExpr) Validate() *eval.ValidationErrors {
217 verr := new(eval.ValidationErrors)
218 if _, err := url.Parse(f.TokenURL); err != nil {
219 verr.Add(f, "invalid token URL %q: %s", f.TokenURL, err)
220 }
221 if _, err := url.Parse(f.AuthorizationURL); err != nil {
222 verr.Add(f, "invalid authorization URL %q: %s", f.AuthorizationURL, err)
223 }
224 if _, err := url.Parse(f.RefreshURL); err != nil {
225 verr.Add(f, "invalid refresh URL %q: %s", f.RefreshURL, err)
226 }
227 return verr
228}
229
230// Type returns the grant type of the OAuth2 grant.
231func (f *FlowExpr) Type() string {

Callers 1

TestFlowExprValidateFunction · 0.95

Calls 1

AddMethod · 0.80

Tested by 1

TestFlowExprValidateFunction · 0.76