jwt.php 2.16 KB
<?php

/**
 * ttl:过期时间(秒)
 */

use App\Support\JwtPayloadFormat;

return [
    'admin'  => [
        'iss'             => env('APP_URL', ''),
        'algorithm'       => 'RS256',
        'access_ttl'      => 7 * 24 * 60 * 60,
        'refresh_ttl'     => 30 * 24 * 60 * 60,
        'access_public'   => storage_path('certs/jwt/admin/access/public.key'),
        'access_private'  => storage_path('certs/jwt/admin/access/private.key'),
        'refresh_public'  => storage_path('certs/jwt/admin/refresh/public.key'),
        'refresh_private' => storage_path('certs/jwt/admin/refresh/private.key'),
        'format'          => JwtPayloadFormat::class
    ],
    'manage' => [
        'iss'             => env('APP_URL', ''),
        'algorithm'       => 'RS256',
        'access_ttl'      => 7 * 24 * 60 * 60,
        'access_public'   => storage_path('certs/jwt/manage/access/public.key'),
        'access_private'  => storage_path('certs/jwt/manage/access/private.key'),
        'refresh_ttl'     => 30 * 24 * 60 * 60,
        'refresh_public'  => storage_path('certs/jwt/manage/refresh/public.key'),
        'refresh_private' => storage_path('certs/jwt/manage/refresh/private.key'),
        'format'          => JwtPayloadFormat::class

    ],
    'app'    => [
        'iss'            => env('APP_URL', ''),
        'type'           => 'Token',
        'algorithm'      => 'HS256',
        'access_ttl'     => 90 * 24 * 60 * 60,
        'access_secret'  => 'django-insecure-z2se)@d6ek9-w9ak4th^gks2mq1mq(t2sg@c(a#0z*$urhy_rh',
        'refresh_ttl'    => 120 * 24 * 60 * 60,
        'refresh_secret' => 'django-insecure-z2se)@d6ek9-w9ak4th^gks2mq1mq(t2sg@c(a#0z*$urhy_rh',
        'format'         => JwtPayloadFormat::class
    ],
    'user'   => [
        'iss'            => env('APP_URL', ''),
        'algorithm'      => 'HS256',
        'access_ttl'     => 30 * 24 * 60 * 60,
        'access_secret'  => 'django-insecure-z2se)@d6ek9-w9ak4th^gks2mq1mq(t2sg@c(a#0z*$urhy_rh',
        'refresh_ttl'    => 60 * 24 * 60 * 60,
        'refresh_secret' => 'django-insecure-z2se)@d6ek9-w9ak4th^gks2mq1mq(t2sg@c(a#0z*$urhy_rh',
        'format'         => JwtPayloadFormat::class
    ]
];