Commit d23472ed authored by ibuler's avatar ibuler

[Update] 修改url

parent 9de03f5e
...@@ -16,4 +16,7 @@ log/ ...@@ -16,4 +16,7 @@ log/
vendor/ vendor/
config.yml config.yml
host_key host_key
cmd/coco cmd/koko
cmd/logs
cmd/kokodir
build
...@@ -101,7 +101,7 @@ func (h *interactiveHandler) loadAssetsFromCache() { ...@@ -101,7 +101,7 @@ func (h *interactiveHandler) loadAssetsFromCache() {
go h.firstLoadAssetAndNodes() go h.firstLoadAssetAndNodes()
} else { } else {
h.assets = make([]model.Asset, 0) h.assets = make([]model.Asset, 0)
h.firstLoadAssetAndNodes() go h.firstLoadAssetAndNodes()
} }
} }
...@@ -159,7 +159,7 @@ func (h *interactiveHandler) Dispatch(ctx cctx.Context) { ...@@ -159,7 +159,7 @@ func (h *interactiveHandler) Dispatch(ctx cctx.Context) {
if err != nil { if err != nil {
if err != io.EOF { if err != io.EOF {
logger.Debug("user disconnected") logger.Debug("User disconnected")
} else { } else {
logger.Error("Read from user err: ", err) logger.Error("Read from user err: ", err)
} }
......
...@@ -57,7 +57,7 @@ func GetSystemUserFilterRules(systemUserID string) (rules []model.SystemUserFilt ...@@ -57,7 +57,7 @@ func GetSystemUserFilterRules(systemUserID string) (rules []model.SystemUserFilt
"filter": "de7693ca-75d5-4639-986b-44ed390260a0" "filter": "de7693ca-75d5-4639-986b-44ed390260a0"
} }
]`*/ ]`*/
Url := fmt.Sprintf(SystemUserCmdFilterRules, systemUserID) Url := fmt.Sprintf(SystemUserCmdFilterRulesListURL, systemUserID)
err = authClient.Get(Url, &rules) err = authClient.Get(Url, &rules)
if err != nil { if err != nil {
...@@ -94,7 +94,7 @@ func GetDomainWithGateway(gID string) (domain model.Domain) { ...@@ -94,7 +94,7 @@ func GetDomainWithGateway(gID string) (domain model.Domain) {
} }
func GetTokenAsset(token string) (tokenUser model.TokenUser) { func GetTokenAsset(token string) (tokenUser model.TokenUser) {
Url := fmt.Sprintf(TokenAssetUrl, token) Url := fmt.Sprintf(TokenAssetURL, token)
err := authClient.Get(Url, &tokenUser) err := authClient.Get(Url, &tokenUser)
if err != nil { if err != nil {
logger.Error("Get Token Asset info failed: ", err) logger.Error("Get Token Asset info failed: ", err)
......
...@@ -102,7 +102,7 @@ func PushSessionCommand(commands []*model.Command) (err error) { ...@@ -102,7 +102,7 @@ func PushSessionCommand(commands []*model.Command) (err error) {
} }
func PushFTPLog(data *model.FTPLog) (err error) { func PushFTPLog(data *model.FTPLog) (err error) {
err = authClient.Post(FTPLogList, data, nil) err = authClient.Post(FTPLogListURL, data, nil)
if err != nil { if err != nil {
logger.Error(err) logger.Error(err)
} }
......
...@@ -3,13 +3,13 @@ package service ...@@ -3,13 +3,13 @@ package service
const ( const (
UserAuthURL = "/api/authentication/v1/auth/" // post 验证用户登陆 UserAuthURL = "/api/authentication/v1/auth/" // post 验证用户登陆
UserProfileURL = "/api/users/v1/profile/" // 获取当前用户的基本信息 UserProfileURL = "/api/users/v1/profile/" // 获取当前用户的基本信息
UserListUrl = "/api/users/v1/users/" // 用户列表地址 UserListURL = "/api/users/v1/users/" // 用户列表地址
UserDetailURL = "/api/users/v1/users/%s/" // 获取用户信息 UserDetailURL = "/api/users/v1/users/%s/" // 获取用户信息
UserAuthOTPURL = "/api/authentication/v1/otp/auth/" // 验证OTP UserAuthOTPURL = "/api/authentication/v1/otp/auth/" // 验证OTP
TokenAssetUrl = "/api/authentication/v1/connection-token/?token=%s" // Token name TokenAssetURL = "/api/authentication/v1/connection-token/?token=%s" // Token name
SystemUserAssetAuthURL = "/api/assets/v1/system-user/%s/asset/%s/auth-info/" // 该系统用户对某资产的授权 SystemUserAssetAuthURL = "/api/assets/v1/system-user/%s/asset/%s/auth-info/" // 该系统用户对某资产的授权
SystemUserCmdFilterRules = "/api/assets/v1/system-user/%s/cmd-filter-rules/" // 过滤规则url SystemUserCmdFilterRulesListURL = "/api/assets/v1/system-user/%s/cmd-filter-rules/" // 过滤规则url
SystemUserDetailURL = "/api/assets/v1/system-user/%s/" // 某个系统用户的信息 SystemUserDetailURL = "/api/assets/v1/system-user/%s/" // 某个系统用户的信息
AssetDetailURL = "/api/assets/v1/assets/%s/" // 某一个资产信息 AssetDetailURL = "/api/assets/v1/assets/%s/" // 某一个资产信息
DomainDetailURL = "/api/assets/v1/domain/%s/?gateway=1" DomainDetailURL = "/api/assets/v1/domain/%s/?gateway=1"
...@@ -22,11 +22,11 @@ const ( ...@@ -22,11 +22,11 @@ const (
SessionDetailURL = "/api/terminal/v1/sessions/%s/" // finish session的时候发送 SessionDetailURL = "/api/terminal/v1/sessions/%s/" // finish session的时候发送
SessionReplayURL = "/api/terminal/v1/sessions/%s/replay/" //上传录像 SessionReplayURL = "/api/terminal/v1/sessions/%s/replay/" //上传录像
SessionCommandURL = "/api/terminal/v1/command/" //上传批量命令 SessionCommandURL = "/api/terminal/v1/command/" //上传批量命令
FTPLogList = "/api/audits/v1/ftp-log/" // 上传 ftp日志
FinishTaskURL = "/api/terminal/v1/tasks/%s/" FinishTaskURL = "/api/terminal/v1/tasks/%s/"
UserAssetsURL = "/api/perms/v1/user/%s/assets/" //获取用户授权的所有资产 FTPLogListURL = "/api/audits/v1/ftp-log/" // 上传 ftp日志
UserNodesAssetsURL = "/api/perms/v1/user/%s/nodes-assets/" // 获取用户授权的所有节点信息 节点分组
ValidateUserAssetPermissionURL = "/api/perms/v1/asset-permission/user/validate/" //0不使用缓存 1 使用缓存 2 刷新缓存 UserAssetsURL = "/api/perms/v1/users/%s/assets/" //获取用户授权的所有资产
UserNodesAssetsURL = "/api/perms/v1/users/%s/nodes-assets/" // 获取用户授权的所有节点信息 节点分组
ValidateUserAssetPermissionURL = "/api/perms/v1/asset-permissions/user/validate/" //0不使用缓存 1 使用缓存 2 刷新缓存
) )
...@@ -44,7 +44,7 @@ func GetProfile() (user *model.User, err error) { ...@@ -44,7 +44,7 @@ func GetProfile() (user *model.User, err error) {
func GetUserByUsername(username string) (user *model.User, err error) { func GetUserByUsername(username string) (user *model.User, err error) {
var users []*model.User var users []*model.User
payload := map[string]string{"username": username} payload := map[string]string{"username": username}
err = authClient.Get(UserListUrl, &users, payload) err = authClient.Get(UserListURL, &users, payload)
if err != nil { if err != nil {
return return
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment