mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-25 03:26:36 +08:00
访问控制支持基本认证和子请求认证
This commit is contained in:
31
pkg/serverconfigs/http_auth_methods.go
Normal file
31
pkg/serverconfigs/http_auth_methods.go
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
||||
|
||||
package serverconfigs
|
||||
|
||||
type HTTPAuthType = string
|
||||
|
||||
const (
|
||||
HTTPAuthTypeBasicAuth HTTPAuthType = "basicAuth" // BasicAuth
|
||||
HTTPAuthTypeSubRequest HTTPAuthType = "subRequest" // 子请求
|
||||
)
|
||||
|
||||
type HTTPAuthTypeDefinition struct {
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
func FindAllHTTPAuthTypes() []*HTTPAuthTypeDefinition {
|
||||
return []*HTTPAuthTypeDefinition{
|
||||
{
|
||||
Name: "基本认证",
|
||||
Code: HTTPAuthTypeBasicAuth,
|
||||
Description: "BasicAuth,最简单的HTTP请求认证方式,通过传递<span class=\"ui label tiny basic text\">Authorization: Basic xxx</span> Header认证。",
|
||||
},
|
||||
{
|
||||
Name: "子请求",
|
||||
Code: HTTPAuthTypeSubRequest,
|
||||
Description: "通过自定义的URL子请求来认证请求。",
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user