Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -657,7 +657,8 @@ func (a *adapter) CreateDb(reset bool) error {
|
||||
// Authentication records for the basic authentication scheme.
|
||||
if _, err = tx.Exec(
|
||||
`CREATE TABLE auth(
|
||||
id INT NOT NULL AUTO_INCREMENT,
|
||||
id INT NOT NULL AUTO_INCREMENT,
|
||||
tenant_id BIGINT NOT NULL,
|
||||
uname VARCHAR(32) NOT NULL,
|
||||
userid BIGINT NOT NULL,
|
||||
scheme VARCHAR(16) NOT NULL,
|
||||
@@ -835,6 +836,7 @@ func (a *adapter) CreateDb(reset bool) error {
|
||||
if _, err = tx.Exec(
|
||||
`CREATE TABLE credentials(
|
||||
id INT NOT NULL AUTO_INCREMENT,
|
||||
tenant_id BIGINT NOT NULL,
|
||||
createdat DATETIME(3) NOT NULL,
|
||||
updatedat DATETIME(3) NOT NULL,
|
||||
deletedat DATETIME(3),
|
||||
|
||||
+8
-2
@@ -801,9 +801,15 @@ func (s *Session) hello(msg *ClientComMessage) {
|
||||
}
|
||||
|
||||
tenantCode := strings.TrimSpace(msg.Hi.Tenant)
|
||||
if tenantCode == "" || len(tenantCode) > 64 {
|
||||
if tenantCode == "" {
|
||||
// Clients that predate the tenant-aware protocol (stock Tinode
|
||||
// webapp/mobile SDKs never send this field) fall back to the
|
||||
// default tenant rather than being rejected. Clients that do
|
||||
// send an explicit code are unaffected.
|
||||
tenantCode = "default"
|
||||
} else if len(tenantCode) > 64 {
|
||||
s.queueOut(ErrMalformed(msg.Id, "", msg.Timestamp))
|
||||
logs.Warn.Println("s.hello: tenant code is missing or invalid", s.sid)
|
||||
logs.Warn.Println("s.hello: tenant code is invalid", s.sid)
|
||||
return
|
||||
}
|
||||
if store.Tenants == nil {
|
||||
|
||||
Reference in New Issue
Block a user