| 61 | var ApiGwAccessToken string |
| 62 | |
| 63 | func IsValidApiVerb(verb string) (error, bool) { |
| 64 | // Is the API verb valid? |
| 65 | if _, ok := whisk.ApiVerbs[strings.ToUpper(verb)]; !ok { |
| 66 | whisk.Debug(whisk.DbgError, "Invalid API verb: '%s'\n", verb) |
| 67 | errMsg := wski18n.T("'{{.verb}}' is not a valid API verb. Valid values are: {{.verbs}}", |
| 68 | map[string]interface{}{ |
| 69 | "verb": verb, |
| 70 | "verbs": reflect.ValueOf(whisk.ApiVerbs).MapKeys()}) |
| 71 | whiskErr := whisk.MakeWskError(errors.New(errMsg), whisk.EXIT_CODE_ERR_GENERAL, |
| 72 | whisk.DISPLAY_MSG, whisk.DISPLAY_USAGE) |
| 73 | return whiskErr, false |
| 74 | } |
| 75 | return nil, true |
| 76 | } |
| 77 | |
| 78 | func hasPathPrefix(path string) (error, bool) { |
| 79 | if !strings.HasPrefix(path, "/") { |