Skip to content

Commit 35187ce

Browse files
committed
perf: update user fields
1 parent 43a80a0 commit 35187ce

9 files changed

Lines changed: 667 additions & 487 deletions

File tree

cmd/impl/convert_pb.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ func ConvertToProtobufUser(user model.User) *pb.User {
2121
IsActive: user.IsActive,
2222
SystemRoles: systemRoles,
2323
OrgRoles: orgRoles,
24+
IsOrgAdmin: user.IsOrgAdmin,
25+
IsSuperuser: user.IsSuperuser,
2426
}
2527
}
2628

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/elastic/go-elasticsearch/v8 v8.14.0
1111
github.com/gorilla/websocket v1.5.3
1212
github.com/huaweicloud/huaweicloud-sdk-go-obs v3.25.4+incompatible
13-
github.com/jumpserver-dev/sdk-go v0.0.0-20251201074529-80d314122472
13+
github.com/jumpserver-dev/sdk-go v0.0.0-20251202100642-4cf5cf0a6c8a
1414
github.com/sirupsen/logrus v1.9.3
1515
github.com/spf13/cobra v1.10.1
1616
github.com/spf13/viper v1.21.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y
6363
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
6464
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
6565
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
66-
github.com/jumpserver-dev/sdk-go v0.0.0-20251201074529-80d314122472 h1:Q1Shgnw1nJL3KG+AeEOhc6JUitrXDgeFpmI2oUh1scc=
67-
github.com/jumpserver-dev/sdk-go v0.0.0-20251201074529-80d314122472/go.mod h1:CDNCGOGgeudYS4IKsHOG+ma1rBSbjv8toKtRax2Z0EE=
66+
github.com/jumpserver-dev/sdk-go v0.0.0-20251202100642-4cf5cf0a6c8a h1:VdK2hysyHHyZuAsv84ZfFUVX8R2J5Igp3yeWScoS58U=
67+
github.com/jumpserver-dev/sdk-go v0.0.0-20251202100642-4cf5cf0a6c8a/go.mod h1:CDNCGOGgeudYS4IKsHOG+ma1rBSbjv8toKtRax2Z0EE=
6868
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
6969
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
7070
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=

protobuf-go/protobuf/common.pb.go

Lines changed: 340 additions & 319 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protobuf-java/org/jumpserver/wisp/Common.java

Lines changed: 248 additions & 101 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protobuf-py/protobuf/common_pb2.py

Lines changed: 62 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protobuf-py/protobuf/common_pb2.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ReviewAccept: RiskLevel
3535
ReviewCancel: RiskLevel
3636

3737
class User(_message.Message):
38-
__slots__ = ("id", "name", "username", "role", "is_valid", "is_active", "org_roles", "system_roles")
38+
__slots__ = ("id", "name", "username", "role", "is_valid", "is_active", "org_roles", "system_roles", "is_superuser", "is_org_admin")
3939
ID_FIELD_NUMBER: _ClassVar[int]
4040
NAME_FIELD_NUMBER: _ClassVar[int]
4141
USERNAME_FIELD_NUMBER: _ClassVar[int]
@@ -44,6 +44,8 @@ class User(_message.Message):
4444
IS_ACTIVE_FIELD_NUMBER: _ClassVar[int]
4545
ORG_ROLES_FIELD_NUMBER: _ClassVar[int]
4646
SYSTEM_ROLES_FIELD_NUMBER: _ClassVar[int]
47+
IS_SUPERUSER_FIELD_NUMBER: _ClassVar[int]
48+
IS_ORG_ADMIN_FIELD_NUMBER: _ClassVar[int]
4749
id: str
4850
name: str
4951
username: str
@@ -52,7 +54,9 @@ class User(_message.Message):
5254
is_active: bool
5355
org_roles: _containers.RepeatedCompositeFieldContainer[OrgRole]
5456
system_roles: _containers.RepeatedCompositeFieldContainer[SystemRole]
55-
def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., username: _Optional[str] = ..., role: _Optional[str] = ..., is_valid: bool = ..., is_active: bool = ..., org_roles: _Optional[_Iterable[_Union[OrgRole, _Mapping]]] = ..., system_roles: _Optional[_Iterable[_Union[SystemRole, _Mapping]]] = ...) -> None: ...
57+
is_superuser: bool
58+
is_org_admin: bool
59+
def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., username: _Optional[str] = ..., role: _Optional[str] = ..., is_valid: bool = ..., is_active: bool = ..., org_roles: _Optional[_Iterable[_Union[OrgRole, _Mapping]]] = ..., system_roles: _Optional[_Iterable[_Union[SystemRole, _Mapping]]] = ..., is_superuser: bool = ..., is_org_admin: bool = ...) -> None: ...
5660

5761
class OrgRole(_message.Message):
5862
__slots__ = ("id", "name", "display_name")

protobuf-rs/message.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ pub struct User {
1818
pub org_roles: ::prost::alloc::vec::Vec<OrgRole>,
1919
#[prost(message, repeated, tag="8")]
2020
pub system_roles: ::prost::alloc::vec::Vec<SystemRole>,
21+
#[prost(bool, tag="9")]
22+
pub is_superuser: bool,
23+
#[prost(bool, tag="10")]
24+
pub is_org_admin: bool,
2125
}
2226
#[derive(Clone, PartialEq, ::prost::Message)]
2327
pub struct OrgRole {

protos/common.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ message User {
1313
bool is_active = 6;
1414
repeated OrgRole org_roles = 7;
1515
repeated SystemRole system_roles = 8;
16+
bool is_superuser = 9;
17+
bool is_org_admin = 10;
1618
}
1719

1820
message OrgRole {

0 commit comments

Comments
 (0)