Skip to content

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

Closed
echarles wants to merge 35 commits into
apache:masterfrom
datalayer-attic:inject-services
Closed

[ZEPPELIN-1354] [WIP] Inject Services#1361
echarles wants to merge 35 commits into
apache:masterfrom
datalayer-attic:inject-services

Conversation

@echarles

Copy link
Copy Markdown
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
Comment threadzeppelin-web/pom.xml Outdated
</goals>
<configuration>
<arguments>build</arguments>
<arguments>build --force</arguments>

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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

@anthonycorbachoanthonycorbacho left a comment

Copy link
Copy Markdown
Contributor

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.

Comment threadpom.xml
<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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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()); ?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@echarles@anthonycorbacho@jongyoul