enh: add authVersion for user privilege
This commit is contained in:
parent
3009df865b
commit
384fed49f9
|
@ -106,6 +106,7 @@ SSdbRaw *mndUserActionEncode(SUserObj *pUser) {
|
|||
SDB_SET_INT64(pRaw, dataPos, pUser->createdTime, _OVER)
|
||||
SDB_SET_INT64(pRaw, dataPos, pUser->updateTime, _OVER)
|
||||
SDB_SET_INT8(pRaw, dataPos, pUser->superUser, _OVER)
|
||||
SDB_SET_INT32(pRaw, dataPos, pUser->authVersion, _OVER)
|
||||
SDB_SET_INT32(pRaw, dataPos, numOfReadDbs, _OVER)
|
||||
SDB_SET_INT32(pRaw, dataPos, numOfWriteDbs, _OVER)
|
||||
|
||||
|
@ -161,6 +162,7 @@ static SSdbRow *mndUserActionDecode(SSdbRaw *pRaw) {
|
|||
SDB_GET_INT64(pRaw, dataPos, &pUser->createdTime, _OVER)
|
||||
SDB_GET_INT64(pRaw, dataPos, &pUser->updateTime, _OVER)
|
||||
SDB_GET_INT8(pRaw, dataPos, &pUser->superUser, _OVER)
|
||||
SDB_GET_INT32(pRaw, dataPos, &pUser->authVersion, _OVER)
|
||||
|
||||
int32_t numOfReadDbs = 0;
|
||||
int32_t numOfWriteDbs = 0;
|
||||
|
@ -588,7 +590,7 @@ _OVER:
|
|||
return code;
|
||||
}
|
||||
|
||||
static int32_t mndSetUserAuthRsp(SMnode *pMnode, SUserObj *pUser, SGetUserAuthRsp *pRsp) {
|
||||
static int32_t mndSetUserAuthRsp(SMnode *pMnode, SUserObj *pUser, SGetUserAuthRsp *pRsp) {
|
||||
memcpy(pRsp->user, pUser->user, TSDB_USER_LEN);
|
||||
pRsp->superAuth = pUser->superUser;
|
||||
pRsp->version = pUser->authVersion;
|
||||
|
@ -711,7 +713,8 @@ static void mndCancelGetNextUser(SMnode *pMnode, void *pIter) {
|
|||
sdbCancelFetch(pSdb, pIter);
|
||||
}
|
||||
|
||||
int32_t mndValidateUserAuthInfo(SMnode *pMnode, SUserAuthVersion *pUsers, int32_t numOfUses, void **ppRsp, int32_t *pRspLen) {
|
||||
int32_t mndValidateUserAuthInfo(SMnode *pMnode, SUserAuthVersion *pUsers, int32_t numOfUses, void **ppRsp,
|
||||
int32_t *pRspLen) {
|
||||
SUserAuthBatchRsp batchRsp = {0};
|
||||
batchRsp.pArray = taosArrayInit(numOfUses, sizeof(SGetUserAuthRsp));
|
||||
if (batchRsp.pArray == NULL) {
|
||||
|
@ -740,7 +743,6 @@ int32_t mndValidateUserAuthInfo(SMnode *pMnode, SUserAuthVersion *pUsers, int32_
|
|||
goto _OVER;
|
||||
}
|
||||
|
||||
|
||||
taosArrayPush(batchRsp.pArray, &rsp);
|
||||
mndReleaseUser(pMnode, pUser);
|
||||
}
|
||||
|
@ -776,6 +778,3 @@ _OVER:
|
|||
tFreeSUserAuthBatchRsp(&batchRsp);
|
||||
return code;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 59e0ebaf4905e4cb6d95a01c58b3fa507abc5a20
|
||||
Subproject commit 2f3dfddd4d9a869e706ba3cf98fb6d769404cd7c
|
Loading…
Reference in New Issue