Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
69thAirhacksQ&A.md

Ask questions and see you at December, 2nd, 6.PM. CET: http://www.ustream.tv/channel/adambien

Also checkout recent episode:

68 airhacks.tv

Please keep the questions Jakarta EE-stic. Means: as short and as concise as only possible. Feel free to ask several, shorter questions.

@kovica

This comment has been minimized.

Copy link

kovica commented Nov 5, 2019

I have seen you using VS Code in last couple of videos.
Could you please explain what extensions do you use and why.

@mlemnian

This comment has been minimized.

Copy link

mlemnian commented Nov 5, 2019

Scenario:

  • Backend-Logic is secured by permission.
  • permissions are associated to groups (roles) and users are associated to groups (roles)
  • There are scheduled Job that are forced to use the same Backend-Logic

Problem:

  • Is there a Standard JEE way of running those jobs with a principal. Currently we're using an ugly (WebSphere) construct like: LoginContext context = new LoginContext("WSLogin", new WSCallbackHandlerImpl(user, password)); context.login();
@victorroeder

This comment has been minimized.

Copy link

victorroeder commented Nov 5, 2019

Hello Adam,
first of all thanks for your maven archetypes.
But they do not consider the 'package' parameter so that the package/directory within the created project is always com.airhacks.

Thus I started with one of them and extend the javaee7-archetype and created a pull-request.
(I commited with snapshot version '1.4-SNAPSHOT' in pom.xml and README.md. Please note this, when you do a release.)

Would be great if you could merge it, this would make it easier to use this archetype. If you don't mind, I could also adapt the other archetypes accordingly.

ONE OTHER NOTE: It seems that your new jakarta-ee archetype is missing in the Maven Central Repository...

Many thanks,
Victor

@mlemnian

This comment has been minimized.

Copy link

mlemnian commented Nov 5, 2019

In a my current project, I received an swagger 2.0 yaml-file from an external system.
I created a rest-client using io.swagger:swagger-codegen-maven-plugin.
But now I've some questions:

  1. How would you handle source code generations?
    1.1 check in the description files like (wsdls, xmls, yamls) and generate the source code during the build
    or
    1.2 generate the source code once and check in the generated sources
  2. swagger-codegen-maven-plugin forces me to decide what rest-client and json framework to use:
    2.1 jersey1 - HTTP client: Jersey client 1.18. JSON processing: Jackson 2.4.2
    2.2 jersey2 - HTTP client: Jersey client 2.6
    2.3 feign - HTTP client: Netflix Feign 8.1.1. JSON processing: Jackson 2.6.3
    2.4 okhttp-gson (default) - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1
    2.5 retrofit - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0)
    2.6 retrofit2 - HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta2)
    2.7 google-api-client - HTTP client: google-api-client 1.23.0. JSON processing: Jackson 2.8.9
    2.8 rest-assured - HTTP client: rest-assured : 3.1.0. JSON processing: Gson 2.6.1. Only for Java8

That means that the client generation is fine for stand alone java clients, but not for clients running in an application server.
I thought I should rely on what the application server provides e.g. JAX-RS X.Y-Client-API instead of an actual implementation. But that would mean I can't use the plugin anymore.
The openapi-generator with https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/jaxrs-spec.md could work, but that would mean that the external system needs to migrate from swagger 2.0 to openapi 3.0. They rejected that request.

I could also use the same framework that is used in the target application server (Websphere 9 classic!). After some research I found out that Websphere 9 classic uses Wink?! with Jackson. But this combination is also not provided by the maven-plugin.

@amihaiemil

This comment has been minimized.

Copy link

amihaiemil commented Nov 14, 2019

Hi Adam,

Do you know of any "full-flow" Oauth2 implementation for Jakarta EE or Quarkus? What I mean is the complete flow, let's say authentication via Github:

  1. user accesses secured JAX-RS resource
  2. user is redirected to Github Login Page and grants permition
  3. user is redirected back to the JAX-RS resource, now having access.

I am aware of Quarkus' Oauth2 Authorization flow, but in this case Quarkus only takes care of validating the token, no actual redirections are performed, as I understand.

I am looking for something that offers everything out-of-the-box, including redirection. Ideally, I'd like to annotate my JAX-RS resources with e.g. @RolesAllowed("github"), setup the configs with clientId and secret provided by Github after registering my app -- that's it.

Thank you,
Mihai

@robert-niestroj

This comment has been minimized.

Copy link

robert-niestroj commented Nov 16, 2019

Regarding covicas comment: what are you'r general thoughts on using VS Code for java programming?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.