You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@knox.apache.org by 吴晓华 <wu...@topsec.com.cn> on 2014/02/14 04:16:54 UTC

I have difficulty in reading the source code

Hello, I am reading the source code of knox,but I don't know from where to
read and how to read. Can anybody help me?
Thanks!

-- 
------------------------------------------------------------
吴晓华
安全技术研究部
北京天融信科技有限公司
地址:北京市海淀区上地东路1号华控大厦3层
邮编:100085
电话:15110172241
电子邮件:wu_xiaohua@topsec.com.cn

Re: I have difficulty in reading the source code

Posted by larry mccay <lm...@apache.org>.
Let me first rewrite my original response from last night - after reading
it again I realize that it was poorly written.

The knox tree is largely broken up into modules for either:

1. "providers" for security related processing of requests and responses as
they
flow through to the hadoop services or

2. "services" for handling, processing rewriting rules and dispatching to
the actual services within the gated hadoop cluster

Okay, so the meaning of provider and contributor....

Providers introduce some functionality into the pipeline that processes the
requests and responses as they flow through the gateway.
Most often they manifest as servlet filters in the chain before and after
dispatch to the services within the Hadoop cluster.

Contributors are part of each provider module and the "contribute" to the
configuration of the webapp that is built for each topology (gateway
deployment descriptor that represents the hadoop cluster).

Unfortunately, there is no architectural documentation available at this
time. Please feel free to lend a hand there if you like.

To further understand the Provider/Contributor aspects that I describe
above, look at the shiro provider source. There are comments in there
describing what is being done and why. That may help.

Thank you for your interest in Knox!


On Fri, Feb 14, 2014 at 3:28 AM, 吴晓华 <wu...@topsec.com.cn> wrote:

> Thanks!
> First I want to know the fremework of the knox, second, how many modules
> are there in knox and the function of every module,third, how the modules
> interact.
>
> What's the meaning of Provider and Contributor, I can not understand them
> accurately.
>
> Are there any documentation of knox?
>
> Thank you very much!
>
>
> 2014-02-14 13:00 GMT+08:00 larry mccay <lm...@apache.org>:
>
> Hi -
>>
>> We will need a little context for what you are looking to understand from
>> the source code in order to help you.
>>
>> The knox tree is largely broken up into modules for either:
>>
>> 1. providers for secure related process of requests and responses as they
>> flow through to the hadoop services or
>> 2. the services for handling, processing rewriting rules and dispatching
>> to
>> the actual services within the gated cluster
>>
>> If, after you take another look at the source - with that understanding,
>> you have additional questions - please feel free to reach out.
>> Preferably, with a bit more context for what you are looking for.
>>
>> I hope that is helpful in some way.
>>
>> --larry
>>
>>
>> 2014-02-13 22:16 GMT-05:00 吴晓华 <wu...@topsec.com.cn>:
>>
>> Hello, I am reading the source code of knox,but I don't know from where
>>> to read and how to read. Can anybody help me?
>>> Thanks!
>>>
>>> --
>>> ------------------------------------------------------------
>>> 吴晓华
>>> 安全技术研究部
>>> 北京天融信科技有限公司
>>> 地址:北京市海淀区上地东路1号华控大厦3层
>>> 邮编:100085
>>> 电话:15110172241
>>> 电子邮件:wu_xiaohua@topsec.com.cn
>>>
>>
>>
>
>
> --
> ------------------------------------------------------------
> 吴晓华
> 安全技术研究部
> 北京天融信科技有限公司
> 地址:北京市海淀区上地东路1号华控大厦3层
> 邮编:100085
> 电话:15110172241
> 电子邮件:wu_xiaohua@topsec.com.cn
>

Re: I have difficulty in reading the source code

Posted by 吴晓华 <wu...@topsec.com.cn>.
Thank you, larry mccay and Kevin Minder, thank you very much, I will read
the source code carefully


2014-02-15 1:53 GMT+08:00 Kevin Minder <ke...@hortonworks.com>:

>  A critical concept is the distinction between Contributors and
> Providers.  In general all of the Knox code can be divided into two
> categories: deployment and runtime.
>
> Deployment covers everything that processes topology files (e.g.
> sandbox.xml) and generates the contents of the deployments directory which
> is essentially WARs.
>
> Runtime covers server startup and request processing.
>
> Contributors are deployment constructs.  For each type of REST API (i.e.
> service) that the gateway supports there is a Contributor.  These take the
> information int the toppoligy file (typically a URL for the service) and
> assemble and configure a set of filters in the deployed WAR that will
> handle the requests made to that service.
>
> Providers are also primarily deployment constructs.  There are Providers
> for various types of functionality: authentication, authorization, etc.
> The Contributors while indirectly use Providers to setup and configure the
> filters that actually do the runtime processing.  This allows the
> Contributor to understand the particulars of a given REST API or service
> and the Provider focus on a particular feature that can be assembled into
> the filter chain for that service.
>
> I start a developer docs section of the wiki and include this type of
> information.
>
>
> On 2/14/14 3:28 AM, 吴晓华 wrote:
>
> Thanks!
> First I want to know the fremework of the knox, second, how many modules
> are there in knox and the function of every module,third, how the modules
> interact.
>
>  What's the meaning of Provider and Contributor, I can not understand
> them accurately.
>
>  Are there any documentation of knox?
>
>  Thank you very much!
>
>
> 2014-02-14 13:00 GMT+08:00 larry mccay <lm...@apache.org>:
>
>> Hi -
>>
>> We will need a little context for what you are looking to understand from
>> the source code in order to help you.
>>
>> The knox tree is largely broken up into modules for either:
>>
>> 1. providers for secure related process of requests and responses as they
>> flow through to the hadoop services or
>> 2. the services for handling, processing rewriting rules and dispatching
>> to
>> the actual services within the gated cluster
>>
>> If, after you take another look at the source - with that understanding,
>> you have additional questions - please feel free to reach out.
>> Preferably, with a bit more context for what you are looking for.
>>
>> I hope that is helpful in some way.
>>
>> --larry
>>
>>
>>  2014-02-13 22:16 GMT-05:00 吴晓华 <wu...@topsec.com.cn>:
>>
>>  Hello, I am reading the source code of knox,but I don't know from where
>>> to read and how to read. Can anybody help me?
>>> Thanks!
>>>
>>>  --
>>>  ------------------------------------------------------------
>>> 吴晓华
>>> 安全技术研究部
>>> 北京天融信科技有限公司
>>> 地址:北京市海淀区上地东路1号华控大厦3层
>>> 邮编:100085
>>> 电话:15110172241
>>> 电子邮件:wu_xiaohua@topsec.com.cn
>>>
>>
>>
>
>
>  --
>  ------------------------------------------------------------
> 吴晓华
> 安全技术研究部
> 北京天融信科技有限公司
> 地址:北京市海淀区上地东路1号华控大厦3层
> 邮编:100085
> 电话:15110172241
> 电子邮件:wu_xiaohua@topsec.com.cn
>
>
>
> CONFIDENTIALITY NOTICE
> NOTICE: This message is intended for the use of the individual or entity
> to which it is addressed and may contain information that is confidential,
> privileged and exempt from disclosure under applicable law. If the reader
> of this message is not the intended recipient, you are hereby notified that
> any printing, copying, dissemination, distribution, disclosure or
> forwarding of this communication is strictly prohibited. If you have
> received this communication in error, please contact the sender immediately
> and delete it from your system. Thank You.




-- 
------------------------------------------------------------
吴晓华
安全技术研究部
北京天融信科技有限公司
地址:北京市海淀区上地东路1号华控大厦3层
邮编:100085
电话:15110172241
电子邮件:wu_xiaohua@topsec.com.cn

Re: I have difficulty in reading the source code

Posted by Kevin Minder <ke...@hortonworks.com>.
A critical concept is the distinction between Contributors and
Providers. In general all of the Knox code can be divided into two
categories: deployment and runtime.

Deployment covers everything that processes topology files (e.g.
sandbox.xml) and generates the contents of the deployments directory
which is essentially WARs.

Runtime covers server startup and request processing.

Contributors are deployment constructs. For each type of REST API (i.e.
service) that the gateway supports there is a Contributor. These take
the information int the toppoligy file (typically a URL for the service)
and assemble and configure a set of filters in the deployed WAR that
will handle the requests made to that service.

Providers are also primarily deployment constructs. There are Providers
for various types of functionality: authentication, authorization, etc.
The Contributors while indirectly use Providers to setup and configure
the filters that actually do the runtime processing. This allows the
Contributor to understand the particulars of a given REST API or service
and the Provider focus on a particular feature that can be assembled
into the filter chain for that service.

I start a developer docs section of the wiki and include this type of
information.

On 2/14/14 3:28 AM, 吴晓华 wrote:
> Thanks!
> First I want to know the fremework of the knox, second, how many
> modules are there in knox and the function of every module,third, how
> the modules interact.
>
> What's the meaning of Provider and Contributor, I can not understand
> them accurately.
>
> Are there any documentation of knox?
>
> Thank you very much!
>
>
> 2014-02-14 13:00 GMT+08:00 larry mccay <lmccay@apache.org
> <ma...@apache.org>>:
>
>     Hi -
>
>     We will need a little context for what you are looking to
>     understand from
>     the source code in order to help you.
>
>     The knox tree is largely broken up into modules for either:
>
>     1. providers for secure related process of requests and responses
>     as they
>     flow through to the hadoop services or
>     2. the services for handling, processing rewriting rules and
>     dispatching to
>     the actual services within the gated cluster
>
>     If, after you take another look at the source - with that
>     understanding,
>     you have additional questions - please feel free to reach out.
>     Preferably, with a bit more context for what you are looking for.
>
>     I hope that is helpful in some way.
>
>     --larry
>
>
>     2014-02-13 22:16 GMT-05:00 吴晓华 <wu_xiaohua@topsec.com.cn
>     <ma...@topsec.com.cn>>:
>
>         Hello, I am reading the source code of knox,but I don't know
>         from where to read and how to read. Can anybody help me?
>         Thanks!
>
>         -- 
>         ------------------------------------------------------------
>         吴晓华
>         安全技术研究部
>         北京天融信科技有限公司
>         地址:北京市海淀区上地东路1号华控大厦3层
>         邮编:100085
>         电话:15110172241
>         电子邮件:wu_xiaohua@topsec.com.cn
>         <ma...@topsec.com.cn>
>
>
>
>
>
> -- 
> ------------------------------------------------------------
> 吴晓华
> 安全技术研究部
> 北京天融信科技有限公司
> 地址:北京市海淀区上地东路1号华控大厦3层
> 邮编:100085
> 电话:15110172241
> 电子邮件:wu_xiaohua@topsec.com.cn <ma...@topsec.com.cn>


-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.

Re: I have difficulty in reading the source code

Posted by 吴晓华 <wu...@topsec.com.cn>.
Thanks!
First I want to know the fremework of the knox, second, how many modules
are there in knox and the function of every module,third, how the modules
interact.

What's the meaning of Provider and Contributor, I can not understand them
accurately.

Are there any documentation of knox?

Thank you very much!


2014-02-14 13:00 GMT+08:00 larry mccay <lm...@apache.org>:

> Hi -
>
> We will need a little context for what you are looking to understand from
> the source code in order to help you.
>
> The knox tree is largely broken up into modules for either:
>
> 1. providers for secure related process of requests and responses as they
> flow through to the hadoop services or
> 2. the services for handling, processing rewriting rules and dispatching to
> the actual services within the gated cluster
>
> If, after you take another look at the source - with that understanding,
> you have additional questions - please feel free to reach out.
> Preferably, with a bit more context for what you are looking for.
>
> I hope that is helpful in some way.
>
> --larry
>
>
> 2014-02-13 22:16 GMT-05:00 吴晓华 <wu...@topsec.com.cn>:
>
> Hello, I am reading the source code of knox,but I don't know from where to
>> read and how to read. Can anybody help me?
>> Thanks!
>>
>> --
>> ------------------------------------------------------------
>> 吴晓华
>> 安全技术研究部
>> 北京天融信科技有限公司
>> 地址:北京市海淀区上地东路1号华控大厦3层
>> 邮编:100085
>> 电话:15110172241
>> 电子邮件:wu_xiaohua@topsec.com.cn
>>
>
>


-- 
------------------------------------------------------------
吴晓华
安全技术研究部
北京天融信科技有限公司
地址:北京市海淀区上地东路1号华控大厦3层
邮编:100085
电话:15110172241
电子邮件:wu_xiaohua@topsec.com.cn

Re: I have difficulty in reading the source code

Posted by larry mccay <lm...@apache.org>.
Hi -

We will need a little context for what you are looking to understand from
the source code in order to help you.

The knox tree is largely broken up into modules for either:

1. providers for secure related process of requests and responses as they
flow through to the hadoop services or
2. the services for handling, processing rewriting rules and dispatching to
the actual services within the gated cluster

If, after you take another look at the source - with that understanding,
you have additional questions - please feel free to reach out.
Preferably, with a bit more context for what you are looking for.

I hope that is helpful in some way.

--larry


2014-02-13 22:16 GMT-05:00 吴晓华 <wu...@topsec.com.cn>:

> Hello, I am reading the source code of knox,but I don't know from where to
> read and how to read. Can anybody help me?
> Thanks!
>
> --
> ------------------------------------------------------------
> 吴晓华
> 安全技术研究部
> 北京天融信科技有限公司
> 地址:北京市海淀区上地东路1号华控大厦3层
> 邮编:100085
> 电话:15110172241
> 电子邮件:wu_xiaohua@topsec.com.cn
>