mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-07 00:25:16 -04:00
Reviewed and corrected authenPolicies.
Made authenPolicies + Identity mandatory for all services. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6279 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c9a8c0e4ec
commit
80bf2f7a39
14 changed files with 109 additions and 92 deletions
|
@ -123,12 +123,11 @@ public:
|
||||||
* @param serviceSerialiser The users service needs this \n
|
* @param serviceSerialiser The users service needs this \n
|
||||||
* in order for gen exchange to deal with its data types
|
* in order for gen exchange to deal with its data types
|
||||||
* @param mServType This should be service type used by the serialiser
|
* @param mServType This should be service type used by the serialiser
|
||||||
* @param gixs This is used for verification of msgs and groups received by Gen Exchange using identities, set to NULL if \n
|
* @param gixs This is used for verification of msgs and groups received by Gen Exchange using identities.
|
||||||
* identity verification is not wanted
|
|
||||||
* @param authenPolicy This determines the authentication used for verfying authorship of msgs and groups
|
* @param authenPolicy This determines the authentication used for verfying authorship of msgs and groups
|
||||||
*/
|
*/
|
||||||
RsGenExchange(RsGeneralDataService* gds, RsNetworkExchangeService* ns,
|
RsGenExchange(RsGeneralDataService* gds, RsNetworkExchangeService* ns,
|
||||||
RsSerialType* serviceSerialiser, uint16_t mServType, RsGixs* gixs = NULL, uint32_t authenPolicy = 0,
|
RsSerialType* serviceSerialiser, uint16_t mServType, RsGixs* gixs, uint32_t authenPolicy,
|
||||||
uint32_t messageStorePeriod = DEFAULT_MSG_STORE_PERIOD);
|
uint32_t messageStorePeriod = DEFAULT_MSG_STORE_PERIOD);
|
||||||
|
|
||||||
virtual ~RsGenExchange();
|
virtual ~RsGenExchange();
|
||||||
|
|
|
@ -186,8 +186,8 @@ class RsGxsIdExchange:
|
||||||
public RsGixs
|
public RsGixs
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RsGxsIdExchange(RsGeneralDataService* gds, RsNetworkExchangeService* ns, RsSerialType* serviceSerialiser, uint16_t mServType)
|
RsGxsIdExchange(RsGeneralDataService* gds, RsNetworkExchangeService* ns, RsSerialType* serviceSerialiser, uint16_t mServType, uint32_t authenPolicy)
|
||||||
:RsGenExchange(gds,ns,serviceSerialiser,mServType, this) { return; }
|
:RsGenExchange(gds,ns,serviceSerialiser,mServType, this, authenPolicy) { return; }
|
||||||
virtual ~RsGxsIdExchange() { return; }
|
virtual ~RsGxsIdExchange() { return; }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -2329,25 +2329,6 @@ int RsServer::StartupRetroShare()
|
||||||
|
|
||||||
|
|
||||||
/**** Photo service ****/
|
/**** Photo service ****/
|
||||||
// create photo authentication policy
|
|
||||||
uint32_t photoAuthenPolicy = 0;
|
|
||||||
|
|
||||||
uint8_t flag = 0;
|
|
||||||
|
|
||||||
flag = GXS_SERV::MSG_AUTHEN_ROOT_PUBLISH_SIGN;
|
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, photoAuthenPolicy,
|
|
||||||
RsGenExchange::RESTRICTED_GRP_BITS);
|
|
||||||
|
|
||||||
// Re-enable later, photo not using gixs yet
|
|
||||||
flag = GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN; // should be GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN for comments
|
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, photoAuthenPolicy,
|
|
||||||
RsGenExchange::RESTRICTED_GRP_BITS);
|
|
||||||
|
|
||||||
flag = GXS_SERV::GRP_OPTION_AUTHEN_AUTHOR_SIGN;
|
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, photoAuthenPolicy,
|
|
||||||
RsGenExchange::GRP_OPTION_BITS);
|
|
||||||
|
|
||||||
|
|
||||||
RsGeneralDataService* photo_ds = new RsDataService(currGxsDir + "/", "photoV2_db",
|
RsGeneralDataService* photo_ds = new RsDataService(currGxsDir + "/", "photoV2_db",
|
||||||
RS_SERVICE_GXSV1_TYPE_PHOTO, NULL);
|
RS_SERVICE_GXSV1_TYPE_PHOTO, NULL);
|
||||||
|
|
||||||
|
@ -2355,9 +2336,8 @@ int RsServer::StartupRetroShare()
|
||||||
photo_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing
|
photo_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// init gxs services
|
// init gxs services
|
||||||
mPhoto = new p3PhotoService(photo_ds, NULL, mGxsIdService, photoAuthenPolicy);
|
mPhoto = new p3PhotoService(photo_ds, NULL, mGxsIdService);
|
||||||
|
|
||||||
// create GXS photo service
|
// create GXS photo service
|
||||||
RsGxsNetService* photo_ns = new RsGxsNetService(
|
RsGxsNetService* photo_ns = new RsGxsNetService(
|
||||||
|
@ -2409,7 +2389,7 @@ int RsServer::StartupRetroShare()
|
||||||
wire_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing
|
wire_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mWire = new p3Wire(wire_ds, NULL);
|
mWire = new p3Wire(wire_ds, NULL, mGxsIdService);
|
||||||
|
|
||||||
// create GXS photo service
|
// create GXS photo service
|
||||||
RsGxsNetService* wire_ns = new RsGxsNetService(
|
RsGxsNetService* wire_ns = new RsGxsNetService(
|
||||||
|
|
|
@ -84,13 +84,15 @@ uint32_t p3GxsChannels::channelsAuthenPolicy()
|
||||||
uint32_t flag = 0;
|
uint32_t flag = 0;
|
||||||
|
|
||||||
flag = GXS_SERV::MSG_AUTHEN_ROOT_PUBLISH_SIGN | GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
|
flag = GXS_SERV::MSG_AUTHEN_ROOT_PUBLISH_SIGN | GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
||||||
|
|
||||||
flag |= GXS_SERV::MSG_AUTHEN_CHILD_PUBLISH_SIGN;
|
flag |= GXS_SERV::MSG_AUTHEN_CHILD_PUBLISH_SIGN;
|
||||||
//flag |= GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN;
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
||||||
|
|
||||||
|
flag = 0;
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::GRP_OPTION_BITS);
|
||||||
|
|
||||||
return policy;
|
return policy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -134,28 +134,18 @@ uint32_t p3GxsCircles::circleAuthenPolicy()
|
||||||
uint32_t policy = 0;
|
uint32_t policy = 0;
|
||||||
uint8_t flag = 0;
|
uint8_t flag = 0;
|
||||||
|
|
||||||
flag = GXS_SERV::MSG_AUTHEN_ROOT_PUBLISH_SIGN;
|
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
|
||||||
|
|
||||||
flag = GXS_SERV::MSG_AUTHEN_CHILD_PUBLISH_SIGN;
|
//flag = GXS_SERV::MSG_AUTHEN_ROOT_PUBLISH_SIGN;
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
//flag = GXS_SERV::MSG_AUTHEN_CHILD_PUBLISH_SIGN;
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
//flag = GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN;
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
//flag = GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
||||||
|
|
||||||
flag = GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN;
|
flag = 0;
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
//flag = GXS_SERV::GRP_OPTION_AUTHEN_AUTHOR_SIGN;
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::GRP_OPTION_BITS);
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
|
||||||
|
|
||||||
flag = GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
|
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
|
||||||
|
|
||||||
flag = GXS_SERV::GRP_OPTION_AUTHEN_AUTHOR_SIGN;
|
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::GRP_OPTION_BITS);
|
|
||||||
|
|
||||||
return policy;
|
return policy;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,13 +64,16 @@ p3GxsForums::p3GxsForums(RsGeneralDataService *gds, RsNetworkExchangeService *ne
|
||||||
uint32_t p3GxsForums::forumsAuthenPolicy()
|
uint32_t p3GxsForums::forumsAuthenPolicy()
|
||||||
{
|
{
|
||||||
uint32_t policy = 0;
|
uint32_t policy = 0;
|
||||||
uint32_t flag = GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN |
|
uint32_t flag = GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN | GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
|
||||||
GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
|
|
||||||
|
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
||||||
|
|
||||||
|
flag |= GXS_SERV::MSG_AUTHEN_ROOT_PUBLISH_SIGN | GXS_SERV::MSG_AUTHEN_CHILD_PUBLISH_SIGN;
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
||||||
|
|
||||||
|
flag = 0;
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::GRP_OPTION_BITS);
|
||||||
|
|
||||||
return policy;
|
return policy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ RsIdentity *rsIdentity = NULL;
|
||||||
/********************************************************************************/
|
/********************************************************************************/
|
||||||
|
|
||||||
p3IdService::p3IdService(RsGeneralDataService *gds, RsNetworkExchangeService *nes)
|
p3IdService::p3IdService(RsGeneralDataService *gds, RsNetworkExchangeService *nes)
|
||||||
: RsGxsIdExchange(gds, nes, new RsGxsIdSerialiser(), RS_SERVICE_GXSV1_TYPE_GXSID),
|
: RsGxsIdExchange(gds, nes, new RsGxsIdSerialiser(), RS_SERVICE_GXSV1_TYPE_GXSID, idAuthenPolicy()),
|
||||||
RsIdentity(this), GxsTokenQueue(this), RsTickEvent(), mIdMtx("p3IdService"),
|
RsIdentity(this), GxsTokenQueue(this), RsTickEvent(), mIdMtx("p3IdService"),
|
||||||
mPublicKeyCache(DEFAULT_MEM_CACHE_SIZE, "GxsIdPublicKeyCache"),
|
mPublicKeyCache(DEFAULT_MEM_CACHE_SIZE, "GxsIdPublicKeyCache"),
|
||||||
mPrivateKeyCache(DEFAULT_MEM_CACHE_SIZE, "GxsIdPrivateKeyCache")
|
mPrivateKeyCache(DEFAULT_MEM_CACHE_SIZE, "GxsIdPrivateKeyCache")
|
||||||
|
@ -149,6 +149,24 @@ p3IdService::p3IdService(RsGeneralDataService *gds, RsNetworkExchangeService *ne
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint32_t p3IdService::idAuthenPolicy()
|
||||||
|
{
|
||||||
|
uint32_t policy = 0;
|
||||||
|
uint8_t flag = 0;
|
||||||
|
|
||||||
|
// Messages are send reputations. normally not by ID holder - so need signatures.
|
||||||
|
flag = GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN | GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
||||||
|
|
||||||
|
// No ID required.
|
||||||
|
flag = 0;
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::GRP_OPTION_BITS);
|
||||||
|
|
||||||
|
return policy;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void p3IdService::service_tick()
|
void p3IdService::service_tick()
|
||||||
{
|
{
|
||||||
|
|
|
@ -160,7 +160,7 @@ class p3IdService: public RsGxsIdExchange, public RsIdentity,
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
p3IdService(RsGeneralDataService* gds, RsNetworkExchangeService* nes);
|
p3IdService(RsGeneralDataService* gds, RsNetworkExchangeService* nes);
|
||||||
|
static uint32_t idAuthenPolicy();
|
||||||
|
|
||||||
virtual void service_tick(); // needed for background processing.
|
virtual void service_tick(); // needed for background processing.
|
||||||
|
|
||||||
|
|
|
@ -86,9 +86,8 @@ std::ostream &operator<<(std::ostream &out, const RsPhotoAlbum &album)
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
p3PhotoService::p3PhotoService(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs,
|
p3PhotoService::p3PhotoService(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs)
|
||||||
uint32_t authenPolicy)
|
: RsGenExchange(gds, nes, new RsGxsPhotoSerialiser(), RS_SERVICE_GXSV1_TYPE_PHOTO, gixs, photoAuthenPolicy()),
|
||||||
: RsGenExchange(gds, nes, new RsGxsPhotoSerialiser(), RS_SERVICE_GXSV1_TYPE_PHOTO, gixs, authenPolicy),
|
|
||||||
mPhotoMutex(std::string("Photo Mutex"))
|
mPhotoMutex(std::string("Photo Mutex"))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -113,6 +112,25 @@ p3PhotoService::p3PhotoService(RsGeneralDataService* gds, RsNetworkExchangeServi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint32_t p3PhotoService::photoAuthenPolicy()
|
||||||
|
{
|
||||||
|
uint32_t policy = 0;
|
||||||
|
uint8_t flag = 0;
|
||||||
|
|
||||||
|
flag = GXS_SERV::MSG_AUTHEN_ROOT_PUBLISH_SIGN | GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
||||||
|
|
||||||
|
flag |= GXS_SERV::MSG_AUTHEN_CHILD_PUBLISH_SIGN;
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
||||||
|
|
||||||
|
flag = GXS_SERV::GRP_OPTION_AUTHEN_AUTHOR_SIGN;
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::GRP_OPTION_BITS);
|
||||||
|
|
||||||
|
return policy;
|
||||||
|
}
|
||||||
|
|
||||||
bool p3PhotoService::updated()
|
bool p3PhotoService::updated()
|
||||||
{
|
{
|
||||||
RsStackMutex stack(mPhotoMutex);
|
RsStackMutex stack(mPhotoMutex);
|
||||||
|
|
|
@ -33,8 +33,9 @@ class p3PhotoService : public RsPhoto, public RsGenExchange
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
p3PhotoService(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs,
|
p3PhotoService(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs);
|
||||||
uint32_t authenPolicy);
|
|
||||||
|
static uint32_t photoAuthenPolicy();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -72,25 +72,15 @@ uint32_t p3Posted::postedAuthenPolicy()
|
||||||
uint32_t policy = 0;
|
uint32_t policy = 0;
|
||||||
uint32_t flag = 0;
|
uint32_t flag = 0;
|
||||||
|
|
||||||
flag = GXS_SERV::MSG_AUTHEN_ROOT_PUBLISH_SIGN;
|
flag = GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN | GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
|
||||||
|
|
||||||
flag = GXS_SERV::MSG_AUTHEN_CHILD_PUBLISH_SIGN;
|
flag |= GXS_SERV::MSG_AUTHEN_ROOT_PUBLISH_SIGN | GXS_SERV::MSG_AUTHEN_CHILD_PUBLISH_SIGN;
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
||||||
|
|
||||||
flag = GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN;
|
flag = 0;
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::GRP_OPTION_BITS);
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
|
||||||
|
|
||||||
flag = GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
|
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
|
||||||
|
|
||||||
return policy;
|
return policy;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,22 +65,13 @@ uint32_t p3Wiki::wikiAuthenPolicy()
|
||||||
|
|
||||||
flag = GXS_SERV::MSG_AUTHEN_ROOT_PUBLISH_SIGN | GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
|
flag = GXS_SERV::MSG_AUTHEN_ROOT_PUBLISH_SIGN | GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
||||||
|
|
||||||
|
flag |= GXS_SERV::MSG_AUTHEN_CHILD_PUBLISH_SIGN;
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
||||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
||||||
|
|
||||||
flag = GXS_SERV::MSG_AUTHEN_CHILD_PUBLISH_SIGN;
|
flag = 0;
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::GRP_OPTION_BITS);
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
|
||||||
|
|
||||||
// Root signatures are not required, as root publish signatures are.
|
|
||||||
flag = GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN;
|
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
|
||||||
|
|
||||||
//flag = GXS_SERV::GRP_OPTION_AUTHEN_AUTHOR_SIGN;
|
|
||||||
//RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::GRP_OPTION_BITS);
|
|
||||||
|
|
||||||
return policy;
|
return policy;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,12 +35,35 @@
|
||||||
RsWire *rsWire = NULL;
|
RsWire *rsWire = NULL;
|
||||||
|
|
||||||
|
|
||||||
p3Wire::p3Wire(RsGeneralDataService* gds, RsNetworkExchangeService* nes)
|
p3Wire::p3Wire(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs *gixs)
|
||||||
:RsGenExchange(gds, nes, new RsGxsWireSerialiser(), RS_SERVICE_GXSV1_TYPE_WIRE), RsWire(this), mWireMtx("WireMtx")
|
:RsGenExchange(gds, nes, new RsGxsWireSerialiser(), RS_SERVICE_GXSV1_TYPE_WIRE, gixs, wireAuthenPolicy()),
|
||||||
|
RsWire(this), mWireMtx("WireMtx")
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint32_t p3Wire::wireAuthenPolicy()
|
||||||
|
{
|
||||||
|
uint32_t policy = 0;
|
||||||
|
uint8_t flag = 0;
|
||||||
|
|
||||||
|
// Edits generally need an authors signature.
|
||||||
|
|
||||||
|
flag = GXS_SERV::MSG_AUTHEN_ROOT_PUBLISH_SIGN | GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
||||||
|
|
||||||
|
flag |= GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN;
|
||||||
|
flag |= GXS_SERV::MSG_AUTHEN_CHILD_PUBLISH_SIGN;
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
||||||
|
|
||||||
|
flag = 0;
|
||||||
|
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::GRP_OPTION_BITS);
|
||||||
|
|
||||||
|
return policy;
|
||||||
|
}
|
||||||
|
|
||||||
void p3Wire::service_tick()
|
void p3Wire::service_tick()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -33,15 +33,17 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wiki Service
|
* Wire Service
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class p3Wire: public RsGenExchange, public RsWire
|
class p3Wire: public RsGenExchange, public RsWire
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
p3Wire(RsGeneralDataService* gds, RsNetworkExchangeService* nes);
|
p3Wire(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs *gixs);
|
||||||
|
static uint32_t wireAuthenPolicy();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue