npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

next-core-security

v3.0.0

Published

The Augmented.js Next - Security.

Downloads

4

Readme

next-core-security

Augmented.js Next Core - Security

API

Table of Contents

AbstractSecurityClient

Extends Object

The abstract Security Client - for use to extend your own

Parameters

  • type

Properties

  • type Security.ClientType The client type
  • uri string The base uri

uri

Properties

type

Properties

  • type Security.ClientType The client type

OAUTH2Client

Extends AbstractSecurityClient

The OAUTH2 Client

authorize

Access Token

Parameters

  • name

authorize

Authorization Token

Parameters

  • name

authorize

Authorize the application/service/module via OAUTH

Parameters

  • name string The name of the application/service/module

access

access the application/service/module via OAUTH

Parameters

  • principal string The principal TODO: Refresh the token and store it

ACLClient

Extends AbstractSecurityClient

Role/Privilege (ACL) Security

authenticate

authenticate the user

Parameters

  • username string The name of the user (login)

  • password string The password for the user (not stored)

  • Throws any Error Failed to authenticate

Returns Security.Context Returns a security context or null is case of failure

ClientType

Augmented.Security.ClientType - Security client type

Type: Symbol

Properties

AuthenticationFactory

AuthenticationFactory Class - Returns a client of given type for use with security

getSecurityClient

Get an instance of a security client

Parameters

  • clientType Security.ClientType The Client Type to return

Returns Security.Client Returns a security client instance

Principal

Pricipal object for use in security as part of the abstract implimentation

Parameters

  • options

Properties

  • fullName string The full name of the principal
  • id number The id of the principal
  • login string The login of the principal
  • email string The email of the principal

Entry

Used to secure a resource via permissions

Parameters

  • p
  • neg
  • permissions array Permissions to add to the entry (optional)
  • negaive boolean Sets negative permissions (optional)

isNegative

Negative flag

Properties

permissions

Gets the permissions

Returns array Permissions

permissions

Sets the permissions

Parameters

  • p
  • permissions array Permissions Array to set

addPermission

Add a permission

Parameters

  • p
  • permission string Permission to add

removePermission

Remove a permission

Parameters

  • p
  • permission string Permission to remove

hasPermission

Returns if this entry has a permission

Parameters

  • p
  • permission string Permission to test for

Returns boolean Returns true if this entry has this permission

setNegative

Sets this entry negaive or positive

Parameters

  • n
  • negative boolean flag True or False

Context

Augmented.Security.Context Used as a security data storage class

Parameters

  • principal Security.Principal The principal for this context
  • permissions array Permissions to add to the context

principal

getPrincipal - get the principal of this context

Returns Security.Principal principal The principal of this context

permissions

getPermissions - Get all the permissions for a principal

Returns array permissions All permissions

permissions

setPermissions - Set all permissions for a principal

Parameters

addPermission

addPermission - Add a new permission for a principal

Parameters

removePermission

removePermission - Remove a permission for a principal

Parameters

hasPermission

hasPermission - checks for a permission for this principal

Parameters