2.2.5 • Published 4 years ago

@atlas-engine/iam v2.2.5

Weekly downloads
1,694
License
MIT
Repository
github
Last release
4 years ago

Identity and Access Management - IAM

Contains the implementation of the IAM contracts interfaces.

Purpose

The AtlasEngine uses IAM for performing authorization related requests. The contracts found in @atlas-engine/iam_contracts provide a template for this.

Two services are available:

  1. IamService

    Used for interaction with the authority. ensureHasClaim allows to check if a given identity has a given claim.

  2. IdentityService

    A service that knows how to transform a given token (e.g. JWT) to an identity that the authority can understand.

Usage Example:

The easiest way to get familiar with the idea is to look at an example; this will illustrate the use of and the interaction between the IamService and the IdentityService:

const identityService: IIdentityService = new IdentityService();
const iamService: IIAMService = new IAMService(new HttpClient(), identityService, this.config.introspectPath);

// Get the identity for a given JWT token.
const token: String = "Place JWT Token here";
const identity: IIdentity = identityService.getIdentity(token);

// Will result in:
//
// 1. An UnauthorizedError HTTP Status code, if the identity is not logged in at the authority.
// 2. A ForbiddenError HTTP Status code, if the identity does not have the given claim.
// 3. Nothing, if the identity has the given claim.
iamService.ensureHasClaim(identity, 'allowd_to_read_data');

// Place protected code here.
(...)

Usage

Using IAM is simple. You can use ensureHasClaim to verify any claim for any identity.

You'll get one of the following results:

  1. Get an Unauthorized Error

    A 401 will be thrown, if the identity is not known to the authority or the token is invalid/expired/etc.

  2. Get a Forbidden Error

    A 403 will be thrown, if the given identity does not have the given claim.

  3. Get Nothing, if the identity has the given claim.

    A 204, which indicates that the identity has the given claim.

Configuration

The IamService needs some minor configurations; it needs to know:

  1. Its authority.
  2. The client secret.
2.2.5-alpha.1

4 years ago

2.2.3

4 years ago

2.2.5

4 years ago

2.2.4

4 years ago

2.2.4-beta.1

4 years ago

2.2.4-alpha.1

4 years ago

2.2.2-beta.1

4 years ago

2.2.2

4 years ago

2.2.1-alpha.1

4 years ago

2.2.1

4 years ago

2.2.1-beta.1

4 years ago

2.2.0

4 years ago

2.1.1-alpha.1

4 years ago

2.1.1-beta.1

4 years ago

2.1.1

4 years ago

2.1.0-beta.3

4 years ago

2.1.0

4 years ago

2.2.0-alpha.1

4 years ago

2.1.0-alpha.4

4 years ago

2.1.0-beta.2

4 years ago

2.1.0-alpha.3

4 years ago

2.1.0-alpha.2

4 years ago

2.1.0-beta.1

4 years ago

2.0.2

4 years ago

2.0.2-beta.1

4 years ago

2.1.0-alpha.1

4 years ago

2.0.1

4 years ago

2.0.1-alpha.1

4 years ago

2.0.0-alpha.9

5 years ago

2.0.0

5 years ago

2.0.0-beta.4

5 years ago

2.0.0-alpha.8

5 years ago

2.0.0-beta.3

5 years ago

2.0.0-alpha.7

5 years ago

2.0.0-beta.2

5 years ago

2.0.0-alpha.6

5 years ago

2.0.0-alpha.4

5 years ago

2.0.0-alpha.5

5 years ago

2.0.0-alpha.3

5 years ago

2.0.0-alpha.2

5 years ago

1.1.0-beta.2

5 years ago

1.1.0

5 years ago

2.0.0-beta.1

5 years ago

2.0.0-alpha.1

5 years ago

1.1.0-beta.1

5 years ago

1.1.0-alpha.1

5 years ago

1.0.8

5 years ago

1.0.8-beta.1

5 years ago

1.0.8-alpha.1

5 years ago

1.0.7

5 years ago

1.0.6-alpha.4

5 years ago

1.0.7-beta.1

5 years ago

1.0.7-alpha.1

5 years ago

1.0.6-alpha.3

5 years ago

1.0.6-alpha.2

5 years ago

1.0.5-alpha.1

5 years ago

1.0.6-alpha.1

5 years ago

1.0.6

5 years ago

1.0.6-beta.1

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2-alpha.1

5 years ago

1.0.2-beta.1

5 years ago

1.0.2

5 years ago

1.0.1-alpha.2

5 years ago

1.0.1-alpha.1

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.2.2-beta.1

5 years ago

0.2.2-alpha.1

5 years ago

0.2.2-alpha.2

5 years ago

0.2.2-alpha.3

5 years ago

0.2.2

5 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago