New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

vweb-security

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vweb-security

通过注解和自定义认证模块,实现权限控制。(使用方式类似Apache Shiro)

latest
npmnpm
Version
0.0.3
Version published
Weekly downloads
0
-100%
Maintainers
0
Weekly downloads
 
Created
Source

权限认证模块

通过注解和自定义认证模块,实现权限控制。(使用方式类似Apache Shiro)

  • 实现自己的认证模块,通过集成 AuthorizingRealm 类并重写 doGetAuthenticationInfodoGetAuthorizationInfo 方法,实现认证以及授权功能。
  • 通过对控制器方法的注解,实现权限控制。

登录认证

const principal = await this.security.login({
    username: 'admin',
    credential: '123456'
}, session);

权限控制

// 需要登录
@RequiresAuthentication
// 需要权限
@RequiresPermissions
// 需要角色
@RequiresRoles

注销认证

await this.security.logout(session);

FAQs

Package last updated on 16 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts