From ddcd28e67f23da83eb8e64fa3e45b16451c82291 Mon Sep 17 00:00:00 2001 From: Joseph Edwards Van Riper III Date: Tue, 12 Feb 2019 13:00:11 -0500 Subject: [PATCH] APIBaiscAuth is misspelling of APIBasicAuth Corrected APIBaiscAuth to APIBasicAuth. Maintained old name (forwarding to new one) for those still using the previous API function name. --- plugins/apiauth/apiauth.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/apiauth/apiauth.go b/plugins/apiauth/apiauth.go index f816029c..aa8c1960 100644 --- a/plugins/apiauth/apiauth.go +++ b/plugins/apiauth/apiauth.go @@ -72,8 +72,8 @@ import ( // AppIDToAppSecret is used to get appsecret throw appid type AppIDToAppSecret func(string) string -// APIBaiscAuth use the basic appid/appkey as the AppIdToAppSecret -func APIBaiscAuth(appid, appkey string) beego.FilterFunc { +// APIBasicAuth use the basic appid/appkey as the AppIdToAppSecret +func APIBasicAuth(appid, appkey string) beego.FilterFunc { ft := func(aid string) string { if aid == appid { return appkey @@ -83,6 +83,11 @@ func APIBaiscAuth(appid, appkey string) beego.FilterFunc { return APISecretAuth(ft, 300) } +// APIBaiscAuth calls APIBasicAuth for previous callers +func APIBaiscAuth(appid, appkey string) beego.FilterFunc { + return APIBaiscAuth(appid, appkey) +} + // APISecretAuth use AppIdToAppSecret verify and func APISecretAuth(f AppIDToAppSecret, timeout int) beego.FilterFunc { return func(ctx *context.Context) {