@x/socket.serverless
v0.4.18
Published
@x/socket feature for exposing the @x/serverless host
Downloads
2
Readme
@x/socket.serverless
@x/socket
middleware to enable @x/serverless over a socket.
Authorisation
The @x/serverless
feature provides authorisation features to the host. Please see the
security guide for information on using this feature.
Aspects
The @x/serverless
feature provides the following aspects:
Property Aspects
userId
Sets the property to the current user identifier.
Type Aspects
authenticated
Requires that the user is authenticated before publishing the message.
userConstraint(expression, failureMessage)
Requires the provided expression evaluates to a truthy value before allowing the message to be published. The expression is passed the current user model.
scopeOwnerOnly(...scopeProperties)
Requires that the current user owns the scope with the specified properties, or that the scope is not owned.
Call Aspects
authenticated
Requires that the user is authenticated before subscribing to the vocabulary.
userConstraint(expression, failureMessage)
Requires the provided expression evaluates to a truthy value before allowing the user to subscribe. The expression is passed the current user model.
userScope
Forces the vocabulary to be scoped by the current userId, along with any other required scope properties.
ownerOnly
Requires the user to be the owner of the scope specified with a scoped
aspect.
scopeOwnerOnly(...scopeProperties)
Requires the user to be the owner of the scope specified by the provided property names.