37 Star 403 Fork 75

GVPrancher/rancher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
transformer.go 398 Bytes
一键复制 编辑 原始数据 按行查看 历史
Craig Jellick 提交于 2018-02-13 11:13 . Auth framework refactor
package common
import "strings"
func TransformToAuthProvider(authConfig map[string]interface{}) map[string]interface{} {
result := map[string]interface{}{}
if m, ok := authConfig["metadata"].(map[string]interface{}); ok {
result["id"] = m["name"]
}
if t, ok := authConfig["type"].(string); ok && t != "" {
result["type"] = strings.Replace(t, "Config", "Provider", -1)
}
return result
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/rancher/rancher.git
git@gitee.com:rancher/rancher.git
rancher
rancher
rancher
v2.2.10-rc2

搜索帮助