
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@softwarecitadel/girouette
Advanced tools
An AdonisJS package allowing decorator-based routing.
node ace add @softwarecitadel/girouette
Girouette allows you to define routes using decorators in your AdonisJS v6 controllers. This approach can make your route definitions more intuitive and keep them close to your controller methods.
To use Girouette decorators, import them in your controller file:
import {
Get,
Post,
Put,
Patch,
Delete,
Any,
Middleware,
Resource,
Where,
} from '@softwarecitadel/girouette'
Then, you can use these decorators to define routes:
import { HttpContext } from '@adonisjs/core/http'
import { Get, Post } from '@softwarecitadel/girouette'
export default class UsersController {
@Get('/users')
async index({ response }: HttpContext) {
// Handle GET request for /users
}
@Post('/users')
async store({ request, response }: HttpContext) {
// Handle POST request for /users
}
}
@Get(pattern: string, name?: string)
@Post(pattern: string, name?: string)
@Put(pattern: string, name?: string)
@Patch(pattern: string, name?: string)
@Delete(pattern: string, name?: string)
@Any(pattern: string, name?: string)
import { middleware } from '#start/kernel'
import { Get, Middleware } from '@softwarecitadel/girouette'
export default class UsersController {
@Get('/admin/users')
@Middleware([middleware.auth()])
async adminIndex({ response }: HttpContext) {
// This route is protected by the auth middleware
}
}
import { Resource } from '@softwarecitadel/girouette'
@Resource('/users', 'users')
export default class UsersController {
// Implement index, show, store, update, and destroy methods
}
import { Get, Where } from '@softwarecitadel/girouette'
export default class PostsController {
@Get('/posts/:slug')
@Where('slug', (value) => /^[a-z0-9-]+$/.test(value))
async show({ params }: HttpContext) {
// This route will only match if the 'slug' parameter consists of lowercase letters, numbers, and hyphens
}
}
You can combine multiple decorators on a single method:
import { Get, Middleware, Where } from '@softwarecitadel/girouette'
import { middleware } from '#start/kernel'
export default class PostsController {
@Get('/posts/:id')
@Middleware([middleware.auth()])
@Where('id', /^\d+$/)
async show({ params }: HttpContext) {
// This route is protected by auth middleware and only matches numeric IDs
}
}
You can apply middleware to all or specific actions of a resource:
import { Resource, ResourceMiddleware } from '@softwarecitedel/girouette'
import { middleware } from '#start/kernel'
@Resource('/admin/posts', 'admin.posts')
@ResourceMiddleware(['store', 'update', 'destroy'], [middleware.auth()])
export default class AdminPostsController {
// Implement resource methods
// store, update, and destroy will be protected by auth middleware
}
This project is licensed under the MIT License.
FAQs
An AdonisJS package allowing decorators-based routing.
The npm package @softwarecitadel/girouette receives a total of 20 weekly downloads. As such, @softwarecitadel/girouette popularity was classified as not popular.
We found that @softwarecitadel/girouette demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.