<?php
use App\Http\Controllers\CommentController;
use Illuminate\Support\Facades\Route;
// The ->scoped() call forces {comment} to resolve through $post->comments,
package com.example.security;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.JwtException;
import io.jsonwebtoken.io.Decoders;
package com.example.demo.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.CorsConfigurationSource;
# Service Account for the application
apiVersion: v1
kind: ServiceAccount
metadata:
name: web-app-sa
namespace: production
module DangerousAction
extend ActiveSupport::Concern
FRESH_WINDOW = 10.minutes
class ConfirmationMismatch < StandardError; end
Rails.application.config.middleware.insert_before 0, Rack::Cors do
# Development CORS - allow any localhost
allow do
origins(
/http:\/\/localhost:\d+/,
/http:\/\/127\.0\.0\.1:\d+/,
<?php
namespace App\Dto;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Validator\Constraints as Assert;
use std::path::{Component, Path, PathBuf};
#[derive(Debug)]
pub enum ResolveError {
Traversal,
NotFound,
<?php
namespace App\Services;
use App\Mail\VerifyEmail;
use App\Models\ContactEmail;
const jwt = require('jsonwebtoken');
const ACCESS_SECRET = process.env.JWT_ACCESS_SECRET;
const REFRESH_SECRET = process.env.JWT_REFRESH_SECRET;
const ISSUER = 'api.example.com';
const AUDIENCE = 'example-web';
class ApplicationPolicy
attr_reader :user, :record
def initialize(user, record)
@user = user
@record = record
import magic
from django import forms
from django.core.exceptions import ValidationError
from django.template.defaultfilters import filesizeformat