We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lets assume user have JAX-RS resource interface as follow:
public interface UserService { @Path("/") @GET User get(); }
He want to have it secured (JWT for example): And creates for that custom annotation, f.e.: Using filters mechanism f.e.
@javax.ws.rs.NameBinding @Retention(RUNTIME) @Target({TYPE, METHOD}) public @interface JWTTokenNeeded { }
https://antoniogoncalves.org/2016/10/03/securing-jax-rs-endpoints-with-jwt/ And adds it to resource:
public interface UserService { @Path("/") @GET @JWTTokenNeeded User get(); }
This custom annotation information should be passed to generated factory, F.e.: Using MetaParameter: setMetaParameter("JWTTokenNeeded", "true");
setMetaParameter("JWTTokenNeeded", "true");
@Request public class UserService_get extends ServerRequest<Void, TestOnCompleteHandlers.User> { UserService_get() { super(new RequestMeta(TestOnCompleteHandlers.UserService.class, "get", Void.class, TestOnCompleteHandlers.User.class), null); setHttpMethod("GET"); setAccept(new String[]{"application/json"}); setPath("/"); setServiceRoot(""); setContentType(new String[]{"application/json"}); setMetaParameter("JWTTokenNeeded", "true"); setResponseReader(response -> new AbstractObjectReader<TestOnCompleteHandlers.User>("org.dominokit.rest.processor.TestOnCompleteHandlers.User") { @Override protected JsonDeserializer<TestOnCompleteHandlers.User> newDeserializer() { return new TestOnCompleteHandlers_UserBeanJsonDeserializerImpl(); } }.read(response.getBodyAsString())); } } }
Then in creating requests or interceptors We cloud see that metadata and act accordingly.
Thanks to that, We would be able to pass ass much metadata to UI wihout any hard dependency.
Examples: Annotation: @JWT Result: setMetaParameter("JWT", "true");
@JWT
setMetaParameter("JWT", "true");
Annotation: @JWT(value="val") Result setMetaParameter("JWT", "val");
@JWT(value="val")
setMetaParameter("JWT", "val");
Annotation: @JWT(value1="val1", value2="val2") Result setMetaParameter("JWT", "{value1:val1, value2: val2}");
@JWT(value1="val1", value2="val2")
setMetaParameter("JWT", "{value1:val1, value2: val2}");
The text was updated successfully, but these errors were encountered:
#77
Sorry, something went wrong.
No branches or pull requests
Lets assume user have JAX-RS resource interface as follow:
He want to have it secured (JWT for example):
And creates for that custom annotation, f.e.:
Using filters mechanism f.e.
https://antoniogoncalves.org/2016/10/03/securing-jax-rs-endpoints-with-jwt/
And adds it to resource:
This custom annotation information should be passed to generated factory, F.e.:
Using MetaParameter:
setMetaParameter("JWTTokenNeeded", "true");
Then in creating requests or interceptors We cloud see that metadata and act accordingly.
Thanks to that, We would be able to pass ass much metadata to UI wihout any hard dependency.
Examples:
Annotation:
@JWT
Result:
setMetaParameter("JWT", "true");
Annotation:
@JWT(value="val")
Result
setMetaParameter("JWT", "val");
Annotation:
@JWT(value1="val1", value2="val2")
Result
setMetaParameter("JWT", "{value1:val1, value2: val2}");
The text was updated successfully, but these errors were encountered: