
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@socialize/requestable
Advanced tools
This package allows the creation of models that can be requested. This package is used by the socialize:friendships package to create user to user friendship requests. It could however also be useful for other models such as event listings or groups which users can request access to.
This is a Meteor package with part of it's code published as a companion NPM package made to work with clients other than Meteor. For example your server is Meteor, but you want to build a React Native app for the client. This allows you to share code between your Meteor server and other clients to give you a competitive advantage when bringing your mobile and web application to market.
Finding the time to maintain FOSS projects can be quite difficult. I am myself responsible for over 30 personal projects across 2 platforms, as well as Multiple others maintained by the Meteor Community Packages organization. Therfore, if you appreciate my work, I ask that you either sponsor my work through GitHub, or donate via Paypal or Patreon. Every dollar helps give cause for spending my free time fielding issues, feature requests, pull requests and releasing updates. Info can be found in the "Sponsor this project" section of the GitHub Repo
This package relies on the npm package simpl-schema so you will need to make sure it is installed as well.
meteor npm install --save simpl-schema
meteor add socialize:requestable
When using this package with React Native, the dependency tree ensures that simpl-schema is loaded so there's no need to install it as when using within Meteor.
npm install --save @socialize/user-requestable
The client side parts of this package are published to NPM as @socialize/cloudinary for use in front ends outside of Meteor.
When using the npm package you'll need to connect to a server, which hosts the server side Meteor code for your app, using Meteor.connect as per the @socialize/react-native-meteor usage example documentation.
Meteor.connect('ws://192.168.X.X:3000/websocket');
When using this package with React Native there is some minor setup required by the @socialize/react-native-meteor package. See @socialize/react-native-meteor react-native for necessary instructions.
Depending on the environment your code runs in, Meteor or React Native, you'll need to import things slightly different.
//Meteor Imports
import { Meteor } from 'meteor/meteor';
import { LinkParent } from 'meteor/socialize:linkable-model';
import { Mongo } from 'meteor/mongo';
import { Request, RequestsCollection } from 'meteor/socialize:requestable';
//Meteor Imports
import Meteor { Mongo } from '@socialize/react-native-meteor';
import { LinkParent } from '@socialize/linkable-model';
import { Request, RequestsCollection } from '@socialize/requestable';
The Rest of the code runs independent of which environment.
import { GroupMember } from './GroupMember.js';
import SimpleSchema from 'simpl-schema';
const GroupsCollection = new Mongo.Collection('groups');
Request.registerRequestType('group');
class Group extends LinkParent {
requestAccess() {
new Request({
...this.getLinkObject(),
type: 'group'
}).save();
}
requests() {
return RequestsCollection.find({
...this.getLinkObject(),
type: 'group',
deniedAt: { $exists: false },
ignoredAt: { $exists: false }
});
}
}
Group.attachCollection(GroupsCollection);
Group.attachSchema(new SimpleSchema({
name: {
type: String,
},
owner: {
type: String,
regEx: SimpleSchema.RegEx.Id,
autoValue() {
if (this.isInsert) {
return this.userId;
}
return undefined;
},
}
}));
Request.onAccepted(Group, function() {
//`this` is the instance of the request that is being accepted
if(this.type === 'group'){
new GroupMember({ userId: this.requesterId }).save();
}
});
Note
This package does not provide any allow/deny rules for requests. You will need to write your own, making sure to check the
typefield to ensure its the type of request you are expecting. Other request types should then be ignored as other packages that use this package will handle their own.
For a more in depth explanation of how to use this package see API.md
This package implements cultofcoders:redis-oplog's namespaces to provide reactive scalability as an alternative to Meteor's livedata. Use of redis-oplog is not required and will not engage until you install the cultofcoders:redis-oplog package and configure it.
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.