Skip to content

Commit

Permalink
Update section on dependent claim values.
Browse files Browse the repository at this point in the history
Update the revnumber to 1.0-RC10 as proposed final draft

Signed-off-by: Scott Stark <[email protected]>
  • Loading branch information
starksm64 committed Sep 6, 2017
1 parent f34db33 commit 41bd367
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
22 changes: 10 additions & 12 deletions spec/src/main/asciidoc/interoperability.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public @interface Claim {
}
----

with `@Dependent` scoping for any CDI defined non-proxyable type.
with `@Dependent` scoping.

MP-JWT implementation are required to throw a `DeploymentException` when detecting the ambiguous use of a
@Claim qualifier that includes inconsistent non-default values for both the value and standard elements as
Expand All @@ -470,21 +470,18 @@ public class MyEndpoint {
}
----

For currently defined standard claims, the set of non-proxyable types include:
The set of types one my use for a claim value injection is:

* java.lang.String
* java.util.Set<java.lang.String>
* java.lang.Long
* java.lang.Boolean
* java.util.Optional
* javax.json.JsonValue subtypes
* java.util.Optional wrapper of the above types.
* org.eclipse.microprofile.jwt.ClaimValue wrapper of the above types.


All other types of claims values should be available with `@RequestScoped` scoping.
MP-JWT implementations are required to support injection of the claim values
using any of:
* The raw type associated with the JsonWebToken claim value.
* `org.eclipse.microprofile.jwt.ClaimValue` wrapper.
* `javax.json.JsonValue` JSON-P subtypes.
using any of these types.

The `org.eclipse.microprofile.jwt.ClaimValue` interface is:
[source,java]
Expand Down Expand Up @@ -611,17 +608,18 @@ allows for injection to occur in non-RequestScoped contexts.

The example shows that one may specify the name of the claim using a
string or a `Claims` enum value. The string form would allow for specifying non-standard
claims while the `Claims` enum approach guards against typos and mis-spellings.
claims while the `Claims` enum approach guards against typos.

#### Handling of Non-RequestScoped Injection of Non-Proxyable Claim Values
#### Handling of Non-RequestScoped Injection of Claim Values
MP-JWT implementations are required to validate the use of claim value injection into contexts that do not match
@RequestScoped. When the target context has @ApplicationScoped or @SessionScoped scope, implementations are
required to generate a `javax.enterprise.inject.spi.DeploymentException`. For any other context, implementations
should issue a warning, that may be suppressed by an implementation specific configuration setting.

[NOTE]
If one needs to inject a claim value into a scope with a lifetime greater than @RequestScoped, such as
@ApplicationScoped or @SessionScoped, one can use the javax.inject.Provider interface to do so.
@ApplicationScoped or @SessionScoped, one can use the javax.inject.Provider or javax.inject.Instance

This comment has been minimized.

Copy link
@johnament

johnament Sep 6, 2017

Contributor

@Provider is from the AtInject spec and is in javax.inject.Provider. javax.enterprise.inject.Instance is from CDI. I would recommend only recommending instance here, since you would need to destroy the bean afterwards.

This comment has been minimized.

Copy link
@starksm64

starksm64 Sep 7, 2017

Author Contributor

Ok.

interfaces to do so.

### JAX-RS Container API Integration
The behavior of the following JAX-RS security related methods is required for
Expand Down
6 changes: 3 additions & 3 deletions spec/src/main/asciidoc/microprofile-jwt-auth-spec.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
= Interoperable JWT RBAC for Microprofile
:author: Scott Stark; Pedro Igor Silva
:email: [email protected]
:revnumber: 1.0 Draft
:revdate: 2017-08-23
:revremark: Proposal
:revnumber: 1.0-RC10
:revdate: 2017-09-05
:revremark: Proposed Final Draft
:version-label!:
:sectanchors:
:doctype: book
Expand Down
1 change: 0 additions & 1 deletion spec/src/main/asciidoc/sample-impl.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ and authorization spec in various container environments. This particular implem
* a default implementation of the JsonWebToken interface
* a JAX-RS ContainerRequestFilter prototype
* JSR-375 IdentityStore and Credential prototypes
* TODO: a JSR-196 ServerAuthModule
### Wildfly Swarm Implementations

Expand Down

0 comments on commit 41bd367

Please sign in to comment.