Commit c9b7f9a4 authored by Eric's avatar Eric

[update] modify service

parent 77ac1fce
package sdk
import (
"cocogo/pkg/logger"
"cocogo/pkg/model"
"fmt"
)
//
//func GetSystemUserAssetAuthInfo(systemUserID, assetID string) (authInfo model.SystemUserAuthInfo, err error) {
//
......@@ -19,13 +13,3 @@ import (
//
//}
//
func GetSystemUserAssetAuthInfo(systemUserID, assetID string) (info model.SystemUserAuthInfo, err error) {
var authInfo model.SystemUserAuthInfo
systemUrl := fmt.Sprintf(urls["SystemUserAuthInfo"], systemUserID)
err = Client.Get(systemUrl, &authInfo, true)
if err != nil {
logger.Info("get User Assets Groups err:", err)
return
}
return
}
......@@ -6,7 +6,6 @@ import (
"cocogo/pkg/common"
"cocogo/pkg/config"
"cocogo/pkg/model"
)
type ClientAuth interface {
......@@ -34,7 +33,7 @@ func (c *WrapperClient) LoadAuth() error {
}
func (c *WrapperClient) CheckAuth() error {
var user model.User
var user User
err := c.Http.Get("UserProfileUrl", &user)
if err != nil {
return err
......
package sdk
var Client = WrapperClient{}
func init() {
//err := Client.LoadAuth()
//if err != nil {
// logger.Error("Load client access key error: %s", err)
// os.Exit(10)
//}
//err = Client.CheckAuth()
//if err != nil {
// logger.Error("Check client auth error: %s", err)
// os.Exit(11)
//}
}
package sdk
import "cocogo/pkg/model"
func CheckAuth(username, password, publicKey, remoteAddr, loginType string) (user model.User, err error) {
func CheckAuth(username, password, publicKey, remoteAddr, loginType string) (user User, err error) {
return user, nil
}
......
package service
import (
"cocogo/pkg/sdk"
)
func GetSystemUserAssetAuthInfo(systemUserID, assetID string) (info sdk.SystemUserAuthInfo) {
return
}
func GetSystemUserAuthInfo(systemUserID string) (info sdk.SystemUserAuthInfo) {
return
}
package service
import "cocogo/pkg/sdk"
import (
"cocogo/pkg/sdk"
)
func GetUserAssets(userId string) (assets []sdk.Asset) {
return
......@@ -9,3 +11,7 @@ func GetUserAssets(userId string) (assets []sdk.Asset) {
func GetUserNodes(userId string) (nodes []sdk.Node) {
return
}
func ValidateUserAssetPermission(userId, assetId, systemUserId string) bool {
return true
}
package service
func registerTerminal(name string) {
}
func CreateServiceAccount() {
}
func CreateSession() {
}
func FinishSession() {
}
func PushSessionReplay(sessionID, gZipFile string) {
}
func FinishReply() {
}
package service
import "cocogo/pkg/sdk"
func Authenticate(username, password, public_key, remote_addr, login_type string) {
return
}
func GetUserProfile(userId string) (user sdk.User) {
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