@travetto/auth 6.0.0-rc.3 → 6.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/types/principal.ts +0 -1
- package/src/types/token.ts +0 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This module provides the high-level backdrop for managing security principals.
|
|
|
21
21
|
* Authorization Context
|
|
22
22
|
|
|
23
23
|
## Standard Types
|
|
24
|
-
The module's goal is to be as flexible as possible. To that end, the primary contract that this module defines, is that of the [Principal](https://github.com/travetto/travetto/tree/main/module/auth/src/types/principal.ts#
|
|
24
|
+
The module's goal is to be as flexible as possible. To that end, the primary contract that this module defines, is that of the [Principal](https://github.com/travetto/travetto/tree/main/module/auth/src/types/principal.ts#L7).
|
|
25
25
|
|
|
26
26
|
**Code: Principal**
|
|
27
27
|
```typescript
|
|
@@ -57,7 +57,7 @@ export interface Principal<D = AnyMap> {
|
|
|
57
57
|
}
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
As referenced above, a [Principal](https://github.com/travetto/travetto/tree/main/module/auth/src/types/principal.ts#
|
|
60
|
+
As referenced above, a [Principal](https://github.com/travetto/travetto/tree/main/module/auth/src/types/principal.ts#L7) is defined as a user with respect to a security context. This can be information the application knows about the user (authorized) or what a separate service may know about a user (3rd-party authentication).
|
|
61
61
|
|
|
62
62
|
## Authentication Contract
|
|
63
63
|
|
|
@@ -136,7 +136,7 @@ export class AuthService {
|
|
|
136
136
|
|
|
137
137
|
The [AuthService](https://github.com/travetto/travetto/tree/main/module/auth/src/service.ts#L13) operates as the owner of the current auth state for a given "request". "Request" here implies a set of operations over a period of time, with the http request/response model being an easy point of reference. This could also tie to a CLI operation, or any other invocation that requires some concept of authentication and authorization.
|
|
138
138
|
|
|
139
|
-
The service allows for storing and retrieving the active [Principal](https://github.com/travetto/travetto/tree/main/module/auth/src/types/principal.ts#
|
|
139
|
+
The service allows for storing and retrieving the active [Principal](https://github.com/travetto/travetto/tree/main/module/auth/src/types/principal.ts#L7), and/or the actively persisted auth token. This is extremely useful for other parts of the framework that may request authenticated information (if available). [Web Auth](https://github.com/travetto/travetto/tree/main/module/auth-web#readme "Web authentication integration support for the Travetto framework") makes heavy use of this state for enforcing endpoints when authentication is required.
|
|
140
140
|
|
|
141
141
|
### Login
|
|
142
142
|
"Logging in" can be thought of going through the action of finding a single source that can authenticate the identity for the request credentials. Some times there may be more than one valid source of authentication that you want to leverage, and the first one to authenticate wins. The [AuthService](https://github.com/travetto/travetto/tree/main/module/auth/src/service.ts#L13) operates in this fashion, in which a set of credentials and potential [Authenticator](https://github.com/travetto/travetto/tree/main/module/auth/src/types/authenticator.ts#L9)s are submitted, and the service will attempt to authenticate.
|
package/package.json
CHANGED
package/src/types/principal.ts
CHANGED