github.com/infraboard/keyauth@v0.8.1/apps/token/pb/token.proto (about) 1 syntax = "proto3"; 2 3 package infraboard.keyauth.token; 4 option go_package = "github.com/infraboard/keyauth/apps/token"; 5 6 import "apps/user/pb/types.proto"; 7 8 enum GrantType { 9 NULL = 0; 10 UNKNOWN = 1; 11 PASSWORD = 2; 12 LDAP = 3; 13 REFRESH = 4; 14 ACCESS = 5; 15 CLIENT = 6; 16 AUTH_CODE = 7; 17 IMPLICIT = 8; 18 WECHAT_WORK = 9; 19 } 20 21 enum TokenType { 22 BEARER = 0; 23 MAC = 1; 24 JWT = 2; 25 } 26 27 enum BlockType { 28 SESSION_TERMINATED = 0; 29 OTHER_CLIENT_LOGGED_IN = 1; 30 OTHER_PLACE_LOGGED_IN = 2; 31 OTHER_IP_LOGGED_IN = 3; 32 } 33 34 message Token { 35 // @gotags: bson:"session_id" json:"session_id" 36 string session_id = 2; 37 // @gotags: bson:"_id" json:"access_token" 38 string access_token = 3; 39 // @gotags: bson:"refresh_token" json:"refresh_token,omitempty" 40 string refresh_token = 4; 41 // @gotags: bson:"create_at" json:"create_at,omitempty" 42 int64 create_at = 5; 43 // @gotags: bson:"access_expired_at" json:"access_expired_at,omitempty" 44 int64 access_expired_at = 6; 45 // @gotags: bson:"refresh_expired_at" json:"refresh_expired_at,omitempty" 46 int64 refresh_expired_at = 7; 47 // @gotags: bson:"domain" json:"domain,omitempty" 48 string domain = 8; 49 // @gotags: bson:"user_type" json:"user_type" 50 user.UserType user_type = 9; 51 // @gotags: bson:"account" json:"account" 52 string account = 10; 53 // @gotags: bson:"application_id" json:"application_id" 54 string application_id = 11; 55 // @gotags: bson:"application_name" json:"application_name" 56 string application_name = 12; 57 // @gotags: bson:"client_id" json:"client_id" 58 string client_id = 13; 59 // @gotags: bson:"start_grant_type" json:"start_grant_type" 60 GrantType start_grant_type = 14; 61 // @gotags: bson:"grant_type" json:"grant_type" 62 GrantType grant_type = 15; 63 // @gotags: bson:"type" json:"type" 64 TokenType type = 16; 65 // @gotags: bson:"namespace_id" json:"namespace_id" 66 string namespace_id = 25; 67 // @gotags: bson:"namespace_name" json:"namespace_name" 68 string namespace_name = 27; 69 // @gotags: bson:"scope" json:"scope" 70 string scope = 17; 71 // @gotags: bson:"description" json:"description" 72 string description = 18; 73 // @gotags: bson:"is_block" json:"is_block" 74 bool is_block = 19; 75 // @gotags: bson:"block_type" json:"block_type" 76 BlockType block_type = 20; 77 // @gotags: bson:"block_at" json:"block_at" 78 int64 block_at = 21; 79 // @gotags: bson:"block_reason" json:"block_reason" 80 string block_reason = 22; 81 // @gotags: bson:"-" json:"-" 82 string remote_ip = 23; 83 // @gotags: bson:"-" json:"-" 84 string user_agent = 24; 85 // @gotags: bson:"-" json:"available_namespace" 86 repeated string available_namespace = 26; 87 } 88 89 message Set { 90 // @gotags: bson:"total" json:"total" 91 int64 total = 1; 92 // @gotags: bson:"items" json:"items" 93 repeated Token items = 2; 94 }