
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
hive-io-rest-example
Advanced tools
An example REST module to help describe implementation details when leveraging the Hive^io framework.
An example REST module to help describe implementation details when leveraging the Hiveio framework.
This example contains a single resource to handle CRUD functionality of a generic Content
object in a Restful implementation. It is a contrived but fairly robust example to illustrate different ways to use Actors in the Hiveio framework.
Once you get the app running using the setup instructions below, you can use the application from the following endpoint(s):
http://localhost/contents (GET, POST)
{
"text": "something"
}
http://localhost/contents/<id> (GET, PATCH, DELETE)
{
"text": "something different"
}
NOTE: Network data models follow the Flux Standard Action specification for network transport. type
and payload
are derived from the routes and data sent respectively in this example.
This is a straight forward CRUD example of a Content
Entity that contains text, a couple Boolean flags, and a count of how many views it has. It stores these Content
s in MongoDB. It leverages Hiveio's built-in telemetry solution with OpenTelemetry. Here's how to use it.
NOTE: This does not include robust error handling, authentication, and other strategies to keep the example straight forward.
To use, you'll need:
To start using:
Dockerfile
FROM fnalabs/hive-base-js:latest
RUN npm install --production --no-optional hive-io-rest-example
docker-compose.yml
version: '3.5'
services:
hive-base-js:
build: .
image: hive-base-js:production
container_name: hive-base-js
environment:
ACTOR: ContentActor
ACTOR_LIB: hive-io-rest-example
ACTOR_URLS: "/contents,/contents/:id"
CLUSTER_SIZE: 1
HTTP_VERSION: 1
SECURE: "false"
TELEMETRY: "true"
TELEMETRY_PLUGINS: '{"mongodb":{"enabled":true,"path":"@opentelemetry/plugin-mongodb"},"mongoose":{"enabled":true,"path":"@wdalmut/opentelemetry-plugin-mongoose"}}'
TELEMETRY_SERVICE_NAME: content
TELEMETRY_URL_METRICS: "http://collector:55681/v1/metrics"
TELEMETRY_URL_TRACES: "http://collector:55681/v1/trace"
MONGO_URL: "mongodb://mongo:27017/contents"
depends_on:
- collector
- mongo
ports:
- 80:3000
networks:
- hive-io
mongo:
image: mongo:4.4.3
container_name: mongo
networks:
- hive-io
restart: on-failure
# telemetry
# TODO: you will need to define your own config for this example
# https://github.com/fnalabs/hive-io/blob/master/dev/collector/collector-config.yml
collector:
image: otel/opentelemetry-collector:0.18.0
container_name: collector
command: ["--config=/conf/collector-config.yml", "--log-level=ERROR"]
depends_on:
- zipkin
volumes:
- ./collector-config.yml:/conf/collector-config.yml
networks:
- hive-io
restart: on-failure
zipkin:
image: openzipkin/zipkin:2.23.2
container_name: zipkin
ports:
- 9411:9411
networks:
- hive-io
restart: on-failure
# networking
networks:
hive-io:
driver: bridge
docker-compose up
The table below contains a reference to the custom environment variables used in the example. Standard environment variables are documented for the following microservice containers:
Name | Type | Default | Description |
---|---|---|---|
MONGO_URL | String | 'mongodb://mongo:27017/contents' | url to connect to MongoDB instance |
FAQs
An example REST module to help describe implementation details when leveraging the Hive^io framework.
The npm package hive-io-rest-example receives a total of 23 weekly downloads. As such, hive-io-rest-example popularity was classified as not popular.
We found that hive-io-rest-example demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.