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

[ZEPPELIN-1354] [WIP] Inject Services #1361

Closed
wants to merge 35 commits into from

Conversation

echarles
Copy link
Member

What is this PR for?

Services like authentication, authorization, security filters... should be injected rather than manually instanciated.

This will allow to give central + finer control and abstracting the functionaly in interface and allow third parties to implement their own functions in with configurable injection points.

For this, I propose to use Guice as injection framework.

What type of PR is it?

Improvement

Todos

  • - Documentation
  • - Tests

What is the Jira issue?

How should this be tested?

Just compile and run

Screenshots (if appropriate)

NA

Questions:

  • Does the licenses files need update? N
  • Is there breaking changes for older versions? N
  • Does this needs documentation? Y

Conflicts:
	pom.xml
	zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java
	zeppelin-zengine/src/main/java/org/apache/zeppelin/conf/ZeppelinConfiguration.java
@@ -127,7 +127,7 @@
<goal>grunt</goal>
</goals>
<configuration>
<arguments>build</arguments>
<arguments>build --force</arguments>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this related to this PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, bad commit, I will remove this at next push.

Conflicts:
	zeppelin-zengine/src/main/java/org/apache/zeppelin/conf/ZeppelinConfiguration.java
Copy link
Contributor

@anthonycorbacho anthonycorbacho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for bringing the DI foundation to Zeppelin, this is awesome, i left some comment, please check and let me know what you think.

@@ -88,7 +88,9 @@
<slf4j.version>1.7.10</slf4j.version>
<log4j.version>1.2.17</log4j.version>
<libthrift.version>0.9.2</libthrift.version>
<governator.version>1.14.2</governator.version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like governator is not used (all import are commented), I think it better to remove it instead of having bunch of commented code.

public void configure(Binder binder) {

binder.bind(WebSecurity.class)
.to((Class<WebSecurity>) conf.getZeppelinWebSecurityClassname());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we add Singleton scope here? what do you think?

webApp.addFilter(org.apache.shiro.web.servlet.ShiroFilter.class, "/api/*",
EnumSet.allOf(DispatcherType.class));

webApp.addEventListener(new org.apache.shiro.web.env.EnvironmentLoaderListener());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldnt be cleaner to import org.apache.shiro.web.env and change this line with
webApp.addEventListener(new EnvironmentLoaderListener()); ?

@asfgit asfgit closed this in c38a0a0 May 9, 2018
asfgit pushed a commit that referenced this pull request May 9, 2018
close #83
close #86
close #125
close #133
close #139
close #146
close #193
close #203
close #246
close #262
close #264
close #273
close #291
close #299
close #320
close #347
close #389
close #413
close #423
close #543
close #560
close #658
close #670
close #728
close #765
close #777
close #782
close #783
close #812
close #822
close #841
close #843
close #878
close #884
close #918
close #989
close #1076
close #1135
close #1187
close #1231
close #1304
close #1316
close #1361
close #1385
close #1390
close #1414
close #1422
close #1425
close #1447
close #1458
close #1466
close #1485
close #1492
close #1495
close #1497
close #1536
close #1545
close #1561
close #1577
close #1600
close #1603
close #1678
close #1695
close #1739
close #1748
close #1765
close #1767
close #1776
close #1783
close #1799
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants