Skip to content
New issue

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

Make NNA constructor that accepts configuration #61

Closed
pjeli opened this issue Jun 22, 2018 · 1 comment
Closed

Make NNA constructor that accepts configuration #61

pjeli opened this issue Jun 22, 2018 · 1 comment
Labels
good first issue Good for newcomers refactor Code structures needs to be reorganized tests Tests need to be changed or added

Comments

@pjeli
Copy link
Collaborator

pjeli commented Jun 22, 2018

If you take a look at the main class, NNAnalyticsRestAPI.java, particularly here:

You'll see that NNA's bootstrap has a sequence and there are opportunities to override values via parameters. These parameters are set by tests.

It would be nice to refactor this whole bootstrap phase to instead (1) allow a passing of the NNA configuration object SecurityContext (today; to be renamed) and (2) overall simplify testing logic by just calling 1 method to initialize NNA and just passing the desired pre-set configuration object.

Using HDFS's MiniClusters as an example -- we want to simply be able to pass in a configuration object during the bootstrap process for testing. In the production case we will pass null and NNA will utilize the ClassLoader stream method like it does today for loading configuration.

@pjeli pjeli added good first issue Good for newcomers refactor Code structures needs to be reorganized tests Tests need to be changed or added labels Jun 22, 2018
@pjeli pjeli added this to the Initial Release milestone Jun 22, 2018
@pjeli
Copy link
Collaborator Author

pjeli commented Jul 13, 2018

This has become a priority in order to make #27 and #28 easier to implement.
Bootstrapping NNA should be as simple as passing a configuration and hitting go.

Then in NNAnalyticsRestAPI.java we can focus on just having 1 bootstrap method and allowing use to have access to SecurityContext as part of the routing lambdas is the magic that will make supporting more Authentication mechanisms simpler.

Today there is a disconnect between SecurityContext/Configuration and all the routing static methods so its not feasible to pass needed information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers refactor Code structures needs to be reorganized tests Tests need to be changed or added
Projects
None yet
Development

No branches or pull requests

1 participant