Metastatic.Semantic.Domains.Auth (Metastatic v0.10.4)

View Source

Authentication and authorization operation patterns for semantic enrichment.

This module defines patterns for detecting auth operations across multiple languages and auth libraries. Patterns are registered with the Metastatic.Semantic.Patterns registry at module load time.

Supported Libraries

Elixir

  • Guardian - JWT authentication
  • Pow - User authentication
  • Bcrypt/Argon2 - Password hashing
  • Ueberauth - OAuth authentication

Python

  • Flask-Login - Flask authentication
  • Django auth - Django authentication
  • passlib - Password hashing
  • PyJWT/python-jose - JWT handling

Ruby

  • Devise - Rails authentication
  • Warden - Rack authentication
  • bcrypt - Password hashing
  • Knock - JWT authentication

JavaScript

  • Passport.js - Node.js authentication
  • jsonwebtoken - JWT handling
  • bcrypt - Password hashing
  • Auth0 - Auth0 SDK

Auth Operations

OperationDescription
:loginUser login/sign-in
:logoutUser logout/sign-out
:authenticateVerify user credentials
:registerUser registration
:verify_tokenJWT/token verification
:generate_tokenJWT/token generation
:refresh_tokenToken refresh
:hash_passwordPassword hashing
:verify_passwordPassword verification
:authorizeCheck authorization/permissions
:oauthOAuth flow operations
:sessionSession management

Pattern Structure

Each pattern is a tuple of {pattern, spec} where:

  • pattern - String or Regex to match function names
  • spec - Map with operation details:
    • :operation - The auth operation type
    • :framework - The auth library identifier
    • :extract_target - Strategy for extracting user/resource

Summary

Functions

Registers all auth patterns for all languages.

Functions

register_all()

@spec register_all() :: :ok

Registers all auth patterns for all languages.

Called automatically when the module is loaded. Can also be called manually to re-register patterns (e.g., after clearing).