區域管理

模塊列表

user

密碼存儲與傳輸

爲了保證安全,服務器不會存儲用戶輸入的原始密碼(input_password),而是存儲一個 加鹽的 hash 值,其算法爲 md5(input_password+".kb2022").lowerHex(),這樣即時服務器的管理人員也無法竊取使用系統的用戶密碼,並且因爲加了鹽想要使用已有的 md5 hash 表進行暴力破解也變得不在可能。

同時網路中也不應該直接傳輸用戶的原始密碼,對於修改密碼等也應該傳輸 md5(input_password+".kb2022").lowerHex() 以保證即時網路被監控也不會泄漏用戶的原始密碼。

用戶接口

所有登入的用戶都可以調用下述函數

管理員接口

只有管理員可以調用下述接口

Password

Password 用於用戶修改自己的登入密碼:

rpc Password (PasswordRequest) returns (PasswordResponse){
    option (google.api.http) = {
        patch: "/api/v1/meta/user/password"
        body: "*"
    };
}

http 路徑:

/api/v1/meta/user/password

權限要求: session

Nickname

Nickname 用於用戶修改自己的昵稱:

rpc Nickname (NicknameRequest) returns (NicknameResponse){
    option (google.api.http) = {
        patch: "/api/v1/meta/user/nickname"
        body: "*"
    };
}

http 路徑:

/api/v1/meta/user/nickname

權限要求: session

Avatar

Avatar 用於用戶修改自己的頭像:

rpc Avatar (AvatarRequest) returns (AvatarResponse){
    option (google.api.http) = {
        patch: "/api/v1/meta/user/avatar"
        body: "*"
    };
}

http 路徑:

/api/v1/meta/user/avatar

權限要求: session

目前服務器未對頭像做出定義,客戶端可以直接忽略或者按照自己的需要使用此值

ID

ID 用於查詢指定 id 的用戶:

rpc ID (IDRequest) returns (IDResponse){
    option (google.api.http) = {
        get: "/api/v1/meta/user/by_id"
    };
}

http 路徑:

/api/v1/meta/user/by_id

權限要求: session

Find

Find 用於查詢用戶:

rpc Find (FindRequest) returns (FindResponse){
    option (google.api.http) = {
        get: "/api/v1/meta/user/find"
    };
}

http 路徑:

/api/v1/meta/user/find

權限要求: session

Add

Add 用於添加一個新的用戶:

rpc Add (AddRequest) returns (AddResponse){
    option (google.api.http) = {
        post: "/api/v1/meta/user"
        body: "*"
    };
}

http 路徑:

/api/v1/meta/user

權限要求: root(1) or user(200)

SetPassword

SetPassword 用於管理員修改用戶密碼,這通常是用戶忘記了自己的密碼而求助與管理員:

rpc SetPassword (SetPasswordRequest) returns (SetPasswordResponse){
    option (google.api.http) = {
        patch: "/api/v1/meta/user/set_password"
        body: "*"
    };
}

http 路徑:

/api/v1/meta/user/set_password

權限要求: root(1) or user(200)

Groups

Groups 用於修改用戶所處於的組,不同的組將擁有不同的系統權限:

rpc Groups (GroupsRequest) returns (GroupsResponse){
    option (google.api.http) = {
        patch: "/api/v1/meta/user/groups"
        body: "*"
    };
}

http 路徑:

/api/v1/meta/user/groups

權限要求: root(1) or user(200)

Areas

Areas 用於修改用戶所管理的區域:

rpc Areas (AreasRequest) returns (AreasResponse){
    option (google.api.http) = {
        patch: "/api/v1/meta/user/areas"
        body: "*"
    };
}

http 路徑:

/api/v1/meta/user/areas

權限要求: root(1) or user(200)

Priority

Areas 用於修改用戶的優先級:

rpc Priority (PriorityRequest) returns (PriorityResponse){
    option (google.api.http) = {
        patch: "/api/v1/meta/user/priority"
        body: "*"
    };
}

http 路徑:

/api/v1/meta/user/priority

權限要求: root(1) or user(200)

Level

Areas 用於修改用戶的等級:

rpc Level (LevelRequest) returns (LevelResponse){
    option (google.api.http) = {
        patch: "/api/v1/meta/user/level"
        body: "*"
    };
}

http 路徑:

/api/v1/meta/user/level

權限要求: root(1) or user(200)

Disable

Disable 用於禁用用戶:

rpc Disable (DisableRequest) returns (DisableResponse){
    option (google.api.http) = {
        delete: "/api/v1/meta/user/{id}"
    };
}

http 路徑:

/api/v1/meta/user/{id}

權限要求: root(1) or user(200)

Enable

Enable 用於將禁用的用戶重新啓用:

rpc Enable (EnableRequest) returns (EnableResponse){
    option (google.api.http) = {
        post: "/api/v1/meta/user/enable/{id}"
    };
}

http 路徑:

/api/v1/meta/user/enable/{id}

權限要求: root(1) or user(200)