auth.go 886 字节
Newer Older
E
eoLinker API Management 已提交
1 2 3
package auth

import (
黄孟柱 已提交
4 5
	"github.com/eolinker/goku-api-gateway/server/dao"
	console_mysql "github.com/eolinker/goku-api-gateway/server/dao/console-mysql"
E
eoLinker API Management 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
)

// 获取认证信息
func GetAuthStatus(strategyID string) (bool, map[string]interface{}, error) {
	return console_mysql.GetAuthStatus(strategyID)
}

// 获取认证信息
func GetAuthInfo(strategyID string) (bool, map[string]interface{}, error) {
	return console_mysql.GetAuthInfo(strategyID)
}

// 编辑认证信息
func EditAuthInfo(strategyID, strategyName, basicAuthList, apikeyList, jwtCredentialList, oauth2CredentialList string, delClientIDList []string) (bool, error) {
	flag, err := console_mysql.EditAuthInfo(strategyID, strategyName, basicAuthList, apikeyList,
		jwtCredentialList, oauth2CredentialList, delClientIDList)
	name := "goku_conn_plugin_strategy"
	if flag {
		dao.UpdateTable(name)
	}
	return flag, err
}