BastionSSO/app/Http/Requests/UpdateServerResourceRequest.php
Boen_Shi 1ec4cbe941 feat(服务器资源): 支持按资源配置复制临时密码并强化使用校验
- 新增资源开关 allow_copy_temp_password 并持久化

- 使用资源时强制访问用户名与密码必填并返回中文提示

- 解析 sso 链接提取 SSOToken,按开关返回临时密码
2026-04-30 09:53:33 +08:00

30 lines
944 B
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdateServerResourceRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255', 'regex:/^[A-Za-z][A-Za-z0-9._-]*$/'],
'display_name' => ['nullable', 'string', 'max:255'],
'parent_id' => ['nullable', 'integer', 'exists:server_resources,id'],
'internal_ip' => ['nullable', 'ip'],
'asset_id' => ['nullable', 'integer', 'min:1'],
'account_id' => ['nullable', 'integer', 'min:1'],
'protocol' => ['nullable', 'string', 'max:64'],
'description' => ['nullable', 'string', 'max:255'],
'allow_copy_temp_password' => ['sometimes', 'boolean'],
'is_active' => ['sometimes', 'boolean'],
];
}
}