定制 seatplus/auth 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

seatplus/auth

Composer 安装命令:

composer require seatplus/auth

包简介

SeAT plus package that handles authentication agnostic to SeAT plus usage as pure API or Web

README 文档

README

CI

Handles authentication, authorisation, and SSO scope compliance for the seatplus EVE Online management platform. This is the core package — seatplus/eveapi and seatplus/web both depend on it.

Overview

Role system

Four role types with distinct membership and permission semantics:

Type Membership Use case
automatic Auto-assigned when a character belongs to a configured corporation or alliance Fleet / alliance access
on-request User applies, moderator approves or denies Corp-specific elevated access
manual Admin explicitly adds / removes individual users One-off grants
opt-in User self-joins if they meet the criteria Opt-in programmes

Affiliation system

Every role has Affiliation records that define permission scope (which EVE entities the role holder can access data for), not membership. Three types:

  • allowed — these corporations / alliances / characters are in scope
  • inverse — everyone except these is in scope
  • forbidden — always excluded, overrides allowed / inverse

SSO scope compliance

IsUserCompliantService checks whether every character owned by a user has all required OAuth scopes. Required scopes are aggregated from global settings, corporation-level SsoScopes records, and alliance-level records. Non-compliant users have their role memberships set to inactive automatically on the next handleMembers() call.

Permission checking

CanUserService::check() runs a Laravel Pipeline to validate a set of EVE entity IDs against a user's permissions. The pipeline strips IDs the user owns, IDs covered by in-game corporation roles (e.g. Director), and IDs covered by Spatie permissions. Any remaining IDs are denied. The superuser permission bypasses all checks.

Installation

composer require seatplus/auth

Publish and run migrations:

php artisan vendor:publish --provider="Seatplus\Auth\AuthServiceProvider"
php artisan migrate

Usage

Add OAuth scopes to a character

By default the minimal scopes are requested. To step up a character to additional scopes, redirect to:

/eve/sso/{character_id}/step_up?add_scopes=esi-skills.read_skills.v1,esi-wallet.read_character_wallet.v1

Check permissions

use Seatplus\Auth\Services\Dtos\ValidateIdsDTO;
use Seatplus\Auth\Services\CanUserService;

$dto = ValidateIdsDTO::make(entity_ids: [12345678], user: $user);
CanUserService::check($user, $dto, permissions: ['view member tracking']);

Development

Requirements

  • PHP 8.3+
  • PostgreSQL (user seatplus, password secret, database laravel @ 127.0.0.1:5432)
  • Redis @ 127.0.0.1:6379

Running the test suite

composer run test           # lint + PHPStan + type-coverage + unit tests
composer run test:unit      # unit tests only
composer run test:lint      # Pint formatting check
composer run lint           # auto-fix formatting with Pint
composer run test:types     # PHPStan static analysis
composer run test:type-coverage  # 100% type coverage check

seatplus/auth 适用场景与选型建议

seatplus/auth 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.11k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 11 月 19 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 seatplus/auth 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 seatplus/auth 我们能提供哪些服务?
定制开发 / 二次开发

基于 seatplus/auth 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 5.11k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 19
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-11-19