How can I make a user discoverable by tag "mhub:xxx"?

39 views
Skip to first unread message

Yogeswari Narayasamy

unread,
Aug 26, 2020, 5:13:15 AM8/26/20
to Tinode General
My objective is to lookup a user by tag "mhub"; something like the folllowing:
I have the following on the server log regarding restricted tags: ['basic' 'mhub' 'mhubconsumer' 'tel']
/home/yogesnsamy/.gvm/pkgsets/go1.14.2/global/bin/tinode -config=/home/yogesnsamy/Coding/MHub/mhub-chat-tinode/mhub-chat-tinode/local.conf -static_data=/home/yogesnsamy/Coding/MHub/tinode/webapp
2020/08/26 16:08:04 Server v0.16:/home/yogesnsamy/.gvm/pkgsets/go1.14.2/global/bin/tinode:undef; pid 25279; 8 process(es)
2020/08/26 16:08:04 Using config from '/home/yogesnsamy/Coding/MHub/mhub-chat-tinode/mhub-chat-tinode/local.conf'
2020/08/26 16:08:04 stats: variables exposed at '/debug/vars'
2020/08/26 16:08:04 Running as a standalone server.
2020/08/26 16:08:04 DB adapter rethinkdb
2020/08/26 16:08:04 Restricted tags: ['basic' 'mhub' 'mhubconsumer' 'tel']
2020/08/26 16:08:04 plugins: no active plugins found
2020/08/26 16:08:04 gRPC/1.28.0 secure server is registered at [:16060]
2020/08/26 16:08:04 Serving static content from '/home/yogesnsamy/Coding/MHub/tinode/webapp' at '/'
2020/08/26 16:08:04 API served from root URL path '/'
2020/08/26 16:08:04 Large media handling enabled fs
2020/08/26 16:08:04 Redirecting connections from HTTP at [:80] to HTTPS at [:6060]
2020/08/26 16:08:04 Listening for client HTTPS connections on [:6060]

While creating a new user with grpc, I'm unable to set Tags to "mhub:xxx" with the error message "2020/08/26 16:57:49 create user: attempt to directly assign restricted tags sD6b_K6Gch0"
        &pbx.ClientMsg{
           Message: &pbx.ClientMsg_Acc{
               Acc: &pbx.ClientAcc{
                   Id:     "2",
                   UserId: "new",
                   Scheme: "basic",                      // basic
                   Secret: []byte(`"banita:banita123"`), // bob:bob123
                   Login:  true,
                   Desc: &pbx.SetDesc{
                       Public: []byte(`{"fn":"Banita Sandhu"}`),
                   },
                   Cred: []*pbx.ClientCred{
                       &pbx.ClientCred{Method: "email", Value: "ban...@example.com"},
                   },
                   Tags: []string{"mhub:cog-user-id-0123456789-abcd"},
               },
           },
       },

Server log:
2020/08/26 16:57:48 grpc in: hi:<id:"1" user_agent:"Golang_Spider_Bot/3.0" ver:"0.15" lang:"EN" >  sD6b_K6Gch0
2020/08/26 16:57:49 grpc in: acc:<id:"2" user_id:"new" scheme:"basic" secret:"\"banita:banita123\"" login:true tags:"mhub:cog-user-id-0123456789-abcd" desc:<public:"{\"fn\":\"Banita Sandhu\"}" > cred:<method:"email" value:"ban...@example.com" > >  sD6b_K6Gch0
2020/08/26 16:57:49 create user: attempt to directly assign restricted tags sD6b_K6Gch0

Client log:
Sending message: hi:<id:"1" user_agent:"Golang_Spider_Bot/3.0" ver:"0.15" lang:"EN" >
Received: &{id:"1" code:201 text:"created" params:<key:"build" value:"\"rethinkdb:undef\"" > params:<key:"maxFileUploadSize" value:"8388608" > params:<key:"maxMessageSize" value:"262144" > params:<key:"maxSubscriberCount" value:"128" > params:<key:"maxTagCount" value:"16" > params:<key:"ver" value:"\"0.16\"" > }
Sending message: acc:<id:"2" user_id:"new" scheme:"basic" secret:"\"banita:banita123\"" login:true tags:"mhub:cog-user-id-0123456789-abcd" desc:<public:"{\"fn\":\"Banita Sandhu\"}" > cred:<method:"email" value:"ban...@example.com" > >
Received: &{id:"2" code:403 text:"permission denied" params:<key:"what" value:"\"tags\"" > }

The conf file:
// Authentication configuration.
   "auth_config": {
       "logical_names": [],

        // Basic (login + password) authentication.
       "basic": {
           // Add 'auth-name:username' to tags making user discoverable by username.
           "add_to_tags": true,
           "min_login_length": 4,
           "min_password_length": 6
       },
       "mhub": {
           "add_to_tags": true,
           "region": "ap-southeast-1",
           "user_pool_id": "ap-southeast-1_irgzTGv6p",
           "app_client_id": "4vnm4n0uch7t3to0v17i4ila82",
           "access_key_id": "AKIAWALZKM66THX4F6PB",
           "secret_access_key": "yIGUtK8VmPQNmmRBB8QH3MjpWV+r0mJxs+uEOvMH",
       },
       "mhubconsumer": {
           "add_to_tags": true,
           "region": "ap-southeast-1",
           "access_key_id": "AKIAWALZKM66THX4F6PB",
           "secret_access_key": "yIGUtK8VmPQNmmRBB8QH3MjpWV+r0mJxs+uEOvMH",
       },

        // Token authentication
       "token": {
           "expire_in": 1209600,

            "serial_num": 1,

            "key": "wfaY2RgF2S1OQI/ZlK+LSrp1KB2jwAdGAIHQ7JZn+Kc="
       }
   },

How can I make a user discoverable by tag "mhub:xxx"?

I've posted this question together with a few others in a single post earlier, but separating it here to ease communication.
Reply all
Reply to author
Forward
0 new messages