linna/auth-mapper-mysql

Mysql mapper 实现认证和授权接口。

v0.2.1 2022-10-24 20:26 UTC

This package is auto-updated.

Last update: 2024-09-12 11:30:47 UTC


README

Linna Logo
Linna Auth Mapper Mysql Logo

Tests PDS Skeleton PHP 8.1

注意:正在进行代码迁移到 PHP 8.1。

关于

此包为框架的认证接口和授权接口提供具体的实现。

映射器使用 PHP PDO 通过 mysql 作为持久化存储。

要求

  • PHP >= 8.1
  • PDO 扩展
  • MySQL 扩展
  • linna/framework v0.28.0|next

安装

使用 composer

composer require linna/auth-mapper-mysql

包内容

来自框架的接口

  • Linna\Authentication\EnhancedAuthenticationMapperInterface
  • Linna\Authorization\PermissionExtendedMapperInterface
  • Linna\Authorization\PermissionMapperInterface
  • Linna\Authorization\RoleExtendedMapperInterface
  • Linna\Authorization\RoleMapperInterface
  • Linna\Authorization\UserExtendedMapperInterface
  • Linna\Authorization\UserMapperInterface

实现

  • Linna\Authentication\EnhancedAuthenticationMapper
    • deleteOldLoginAttempts()
    • fetchAll()
    • fetchAttemptsWithSameIp()
    • fetchAttemptsWithSameSession()
    • fetchAttemptsWithSameUser()
    • fetchById()
    • fetchLimit()
  • Linna\Authorization\PermissionExtendedMapper
  • Linna\Authorization\PermissionMapper
    • fetchAll()
    • fetchById()
    • fetchByName()
    • fetchByRole()
    • fetchByRoleId()
    • fetchByRoleName()
    • fetchByUser()
    • fetchByUserId()
    • fetchByUserName()
    • fetchLimit()
    • fetchUserPermissionHashTable()
    • permissionExistById()
    • permissionExistByName()
  • Linna\Authorization\RoleExtendedMapper
    • addUser()
    • addUserById()
    • addUserByName()
    • grantPermission()
    • grantPermissionById()
    • grantPermissionByName()
    • removeUser()
    • removeUserById()
    • removeUserByName()
    • revokePermission()
    • revokePermissionById()
    • revokePermissionByName()
  • Linna\Authorization\RoleMapper
    • fetchAll()
    • fetchById()
    • fetchByName()
    • fetchByPermission()
    • fetchByPermissionId()
    • fetchByPermissionName()
    • fetchByUser()
    • fetchByUserId()
    • fetchByUserName()
    • fetchLimit()
  • Linna\Authorization\UserExtendedMapper
    • addRole()
    • addRoleById()
    • addRoleByName()
    • grantPermission()
    • grantPermissionById()
    • grantPermissionByName()
    • removeRole()
    • removeRoleById()
    • removeRoleByName()
    • revokePermission()
    • revokePermissionById()
    • revokePermissionByName()
  • Linna\Authorization\UserMapper
    • fetchAll()
    • fetchById()
    • fetchByName()
    • fetchByPermission()
    • fetchByPermissionId()
    • fetchByPermissionName()
    • fetchByRole()
    • fetchByRoleId()
    • fetchByRoleName()
    • fetchLimit()