smithery/valec3

backend-codeigniter-filters

Middleware/filters, authentication, CORS.

Installation

$ npx skills add smithery/valec3 --skill backend-codeigniter-filters

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/valec3 · top by installs.

npx skills add smithery/valec3

Browse all from smithery/valec3

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,681 B
  • docs SUMMARY.md 76 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Backend CodeIgniter Filters

When to use this skill

  • Authentication
  • CORS
  • Rate limiting
  • Request/response modification

Workflow

  • Create filter class
  • Register in Config/Filters.php
  • Apply to routes
  • Handle before/after
  • Return responses or modify request

Instructions

Auth Filter

<?php

namespace App\Filters;

use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Filters\FilterInterface;

class AuthFilter implements FilterInterface
{
    public function before(RequestInterface $request, $arguments = null)
    {
        $token = $request->getHeaderLine('Authorization');
        
        if (!$this->validateToken($token)) {
            return Services::response()
                ->setJSON(['error' => 'Unauthorized'])
                ->setStatusCode(401);
        }
    }

    public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
    {
        // Post-processing
    }
}

CORS Filter

<?php

class CorsFilter implements FilterInterface
{
    public function before(RequestInterface $request, $arguments = null)
    {
        header('Access-Control-Allow-Origin: *');
        header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE');
        header('Access-Control-Allow-Headers: Content-Type, Authorization');

        if ($request->getMethod() === 'options') {
            exit;
        }
    }
}

Resources

  • before() runs before controller
  • after() runs after controller
  • Return response to short-circuit