Skip to content

Commit f772c2f

Browse files
committed
Simplify output; remove role information
1 parent 209e553 commit f772c2f

3 files changed

Lines changed: 3 additions & 26 deletions

File tree

modal/cli/token.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,6 @@ async def identity():
9191

9292
if resp.HasField("user_identity"):
9393
console.print(f"[bold]User:[/bold] {resp.user_identity.username} [dim]({resp.user_identity.user_id})[/dim]")
94-
95-
role_map = {
96-
api_pb2.MEMBER_ROLE_USER: "User",
97-
api_pb2.MEMBER_ROLE_MANAGER: "Manager",
98-
api_pb2.MEMBER_ROLE_OWNER: "Owner",
99-
}
100-
if role_display := role_map.get(resp.member_role):
101-
if resp.is_admin:
102-
role_display += " / Platform Admin"
103-
console.print(f"[bold]Role:[/bold] {role_display}")
10494
elif resp.HasField("service_user_identity"):
10595
service = resp.service_user_identity
10696
console.print(f"[bold]Service User:[/bold] {service.service_user_name} [dim]({service.service_user_id})[/dim]")

modal_proto/api.proto

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,6 @@ enum GPUType {
164164
GPU_TYPE_H200 = 12;
165165
}
166166

167-
enum MemberRole {
168-
MEMBER_ROLE_UNSPECIFIED = 0;
169-
MEMBER_ROLE_USER = 1;
170-
MEMBER_ROLE_MANAGER = 2;
171-
MEMBER_ROLE_OWNER = 3;
172-
}
173-
174167
enum ObjectCreationType {
175168
OBJECT_CREATION_TYPE_UNSPECIFIED = 0; // just lookup
176169
OBJECT_CREATION_TYPE_CREATE_IF_MISSING = 1;
@@ -3340,18 +3333,14 @@ message TokenIdentityGetResponse {
33403333
string workspace_id = 2;
33413334
string workspace_name = 3;
33423335

3343-
oneof principal {
3336+
oneof identity {
33443337
UserIdentity user_identity = 4;
33453338
ServiceUserIdentity service_user_identity = 5;
33463339
}
33473340

3348-
// Role and permissions
3349-
MemberRole member_role = 6; // OWNER/MANAGER/USER (for users only)
3350-
bool is_admin = 7; // Modal platform admin status
3351-
33523341
// Token metadata
3353-
google.protobuf.Timestamp created_at = 8;
3354-
google.protobuf.Timestamp expires_at = 9;
3342+
google.protobuf.Timestamp created_at = 6;
3343+
google.protobuf.Timestamp expires_at = 7;
33553344
}
33563345

33573346
message TunnelData {

test/cli_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,6 @@ def test_token_identity(servicer, set_env_client):
169169
assert "ak-test123" in res.stdout
170170
assert "test-workspace" in res.stdout
171171
assert "test-user" in res.stdout
172-
assert "Owner" in res.stdout
173-
assert "Platform Admin" not in res.stdout
174172

175173

176174
def test_token_identity_from_env(servicer, set_env_client, monkeypatch):

0 commit comments

Comments
 (0)