Can't get rejected by Lenya
Ben Pracht <[email protected]> Thu, 17 Oct 2013 00:23:01 -0400
| Newsgroups | gmane.comp.cms.lenya.user |
|---|---|
| Message-ID | <CAPB8cd00s7vU-Yw3Jm=BPtKrqKjL3DgB+aN=vFyA5ZxD8BSLoA@mail.gmail.com> |
--001a11c3db745bc0d004e8e82cb7
Content-Type: text/plain; charset=ISO-8859-1
I'm using a prebuilt Lenya 1.2.5. I'm trying to *not* have to write code
to do this.
I'm doing a non-public site for a local club in my area that I want to have
members sign on before even seeing any content. I'd essentially like to
deny the world, even localhost, unless they first authenticate.
Below is what I'm working with. I'm sorry if I omitted anything, I just
could not make sense of the security mechanism enough to know what's
relevant.
An example URL I'd like blocked is:
http://localhost:8888/MembersOnly/live/Welcome.html
lenya/pubs/MembersOnly/config/ac/policies/live/Welcome/subtree-policy.acml
lenya/pubs/MembersOnly/config/ac/policies/live/subtree-policy.acml
lenya/pubs/MembersOnly/config/ac/policies/subtree-policy.acml
Each of the above look like this:
My ac.xconf looks like:
<policy xmlns="http://apache.org/cocoon/lenya/ac/1.0">
<world>
<role id="visit" method="deny"/>
</world>
</policy>
<access-controller type="bypassable">
<accreditable-manager type="file">
<parameter name="directory"
value="context:///lenya/pubs/MembersOnly/config/ac/passwd"/>
<user-manager>
<user-type class="org.apache.lenya.ac.file.FileUser"
create-use-case="userAddUser">Local User</user-type>
<!-- uncomment the following line if you want LDAP support -->
<!-- <user-type class="org.apache.lenya.ac.ldap.LDAPUser"
create-use-case="userAddUserLdap">LDAP User</user-type> -->
</user-manager>
</accreditable-manager>
<policy-manager type="document">
<policy-manager type="file">
<parameter name="directory"
value="context:///lenya/pubs/MembersOnly/config/ac/policies"/>
</policy-manager>
</policy-manager>
<authorizer type="policy"/>
<authorizer type="usecase">
<parameter name="configuration"
value="context:///lenya/pubs/MembersOnly/config/ac/usecase-policies.xml"/>
</authorizer>
<authorizer type="workflow"/>
</access-controller>
---------- Log file snippet -------
24995 2013-10-12 00:31:35,383 [PoolThread-4] DEBUG
lenya.ac.cache.get():161 - Caching object
[org.apache.lenya.ac.impl.DefaultPolicy@65089d7] for further requests of
[file:/C:/java/eclipse/ClubSoftware/Lenya/lenya/pubs/MembersOnly/config/ac/policies/live/Welcome/subtree-policy.acml].
24996 2013-10-12 00:31:35,384 [PoolThread-4] DEBUG
lenya.ac.policymanager.file.buildPolicy():149 - Policy exists: [true]
24996 2013-10-12 00:31:35,384 [PoolThread-4] DEBUG
lenya.ac.authorizer.policy.saveRoles():156 - Adding roles [ visit ] to
request [org.apache.cocoon.environment.http.HttpRequest@2457c24c]
24996 2013-10-12 00:31:35,384 [PoolThread-4] DEBUG
lenya.ac.authorizer.policy.authorize():111 - Authorized: true
24996 2013-10-12 00:31:35,384 [PoolThread-4] DEBUG
lenya.ac.accesscontroller.bypassable.authorize():121 - Authorizer
[org.apache.lenya.ac.impl.PolicyAuthorizer@6566aa35] returned [true]
24996 2013-10-12 00:31:35,384 [PoolThread-4] DEBUG
lenya.ac.accesscontroller.bypassable.authorize():108 -
---------------------------------------------------------
24996 2013-10-12 00:31:35,384 [PoolThread-4] DEBUG
lenya.ac.accesscontroller.bypassable.authorize():109 - Invoking authorizer
[org.apache.lenya.cms.ac.usecase.UsecaseAuthorizer@26456721]
24997 2013-10-12 00:31:35,385 [PoolThread-4] DEBUG
lenya.ac.authorizer.usecase.authorize():104 - No usecase to authorize.
Granting access.
24997 2013-10-12 00:31:35,385 [PoolThread-4] DEBUG
lenya.ac.accesscontroller.bypassable.authorize():121 - Authorizer
[org.apache.lenya.cms.ac.usecase.UsecaseAuthorizer@26456721] returned [true]
24997 2013-10-12 00:31:35,385 [PoolThread-4] DEBUG
lenya.ac.accesscontroller.bypassable.authorize():108 -
---------------------------------------------------------
24997 2013-10-12 00:31:35,385 [PoolThread-4] DEBUG
lenya.ac.accesscontroller.bypassable.authorize():109 - Invoking authorizer
[org.apache.lenya.cms.ac.workflow.WorkflowAuthorizer@7e1b0beb]
24997 2013-10-12 00:31:35,385 [PoolThread-4] DEBUG
lenya.ac.authorizer.workflow.authorize():69 - Authorizing workflow for
event [null]
24997 2013-10-12 00:31:35,385 [PoolThread-4] DEBUG
lenya.ac.accesscontroller.bypassable.authorize():121 - Authorizer
[org.apache.lenya.cms.ac.workflow.WorkflowAuthorizer@7e1b0beb] returned
[true]
24997 2013-10-12 00:31:35,385 [PoolThread-4] DEBUG
lenya.ac.accesscontroller.bypassable.authorize():130 -
=========================================================
24997 2013-10-12 00:31:35,385 [PoolThread-4] DEBUG
lenya.ac.accesscontroller.bypassable.authorize():131 - Authorization
complete, result: [true]
24998 2013-10-12 00:31:35,386 [PoolThread-4] DEBUG
lenya.ac.accesscontroller.bypassable.authorize():132 -
=========================================================
24998 2013-10-12 00:31:35,386 [PoolThread-4] DEBUG
sitemap.decommission():342 - ComponentFactory decommissioning instance of
org.apache.lenya.cms.cocoon.acting.DelegatingAuthorizerAction.
--001a11c3db745bc0d004e8e82cb7
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><div>I'm using a prebuilt Lenya 1.2.5.=A0 I'm=
trying to *not* have to write code to do this.<br><br>I'm doing a non-=
public site for a local club in my area that I want to have members sign on=
before even seeing any content.=A0 I'd essentially like to deny the wo=
rld, even localhost, unless they first authenticate.<br>
</div><div><br></div><div>Below is what I'm working with.=A0 I'm so=
rry if I omitted anything, I just could not make sense of the security mech=
anism enough to know what's relevant.<br><br></div>An example URL I'=
;d like blocked is:<br>
<a href=3D"http://localhost:8888/MembersOnly/live/Welcome.html">http://loca=
lhost:8888/MembersOnly/live/Welcome.html</a><br><br></div><div><br></div>le=
nya/pubs/MembersOnly/config/ac/policies/live/Welcome/subtree-policy.acml<br=
>
lenya/pubs/MembersOnly/config/ac/policies/live/subtree-policy.acml<br>lenya=
/pubs/MembersOnly/config/ac/policies/subtree-policy.acml<br><br><div>Each o=
f the above look like this:<br><br><br>My ac.xconf looks like:<br><br><p=
olicy xmlns=3D"<a href=3D"http://apache.org/cocoon/lenya/ac/1.0">http:=
//apache.org/cocoon/lenya/ac/1.0</a>"><br>
<br>=A0 <world><br>=A0=A0=A0 <role id=3D"visit" method=
=3D"deny"/><br>=A0 </world><br>=A0 <br></policy> <=
br><br><access-controller type=3D"bypassable"><br>=A0 <br>=
=A0 <accreditable-manager type=3D"file"><br>
=A0=A0=A0 <parameter name=3D"directory" value=3D"context:=
///lenya/pubs/MembersOnly/config/ac/passwd"/><br><br>=A0=A0=A0 <=
user-manager><br>=A0=A0=A0=A0=A0=A0 <user-type class=3D"org.apac=
he.lenya.ac.file.FileUser" create-use-case=3D"userAddUser"&g=
t;Local User</user-type><br>
=A0=A0=A0=A0=A0=A0 <!-- uncomment the following line if you want LDAP su=
pport --><br>=A0=A0=A0=A0=A0=A0 <!-- <user-type class=3D"org.=
apache.lenya.ac.ldap.LDAPUser" create-use-case=3D"userAddUserLdap=
">LDAP User</user-type> --><br>
=A0=A0=A0 </user-manager><br>=A0 </accreditable-manager><br>=A0=
<br>=A0 <policy-manager type=3D"document"><br>=A0=A0=A0 &l=
t;policy-manager type=3D"file"><br>=A0=A0=A0=A0=A0 <paramet=
er name=3D"directory" value=3D"context:///lenya/pubs/Members=
Only/config/ac/policies"/><br>
=A0=A0=A0 </policy-manager><br>=A0 </policy-manager><br>=A0 <br=
>=A0 <authorizer type=3D"policy"/><br>=A0 <br>=A0 <autho=
rizer type=3D"usecase"><br>=A0 =A0=A0=A0 <parameter name=3D=
"configuration" value=3D"context:///lenya/pubs/MembersOnly/c=
onfig/ac/usecase-policies.xml"/><br>
=A0 </authorizer><br>=A0 <br>=A0 <authorizer type=3D"workflow=
"/><br>=A0 <br></access-controller><br><br></div><div>-------=
--- Log file snippet -------<br>24995 2013-10-12 00:31:35,383 [PoolThread-4=
] DEBUG lenya.ac.cache.get():161=A0 - Caching object [org.apache.lenya.ac.i=
mpl.DefaultPolicy@65089d7] for further requests of [file:/C:/java/eclipse/C=
lubSoftware/Lenya/lenya/pubs/MembersOnly/config/ac/policies/live/Welcome/su=
btree-policy.acml].<br>
<br>24996 2013-10-12 00:31:35,384 [PoolThread-4] DEBUG lenya.ac.policymanag=
er.file.buildPolicy():149=A0 - Policy exists: [true]<br><br>24996 2013-10-1=
2 00:31:35,384 [PoolThread-4] DEBUG lenya.ac.authorizer.policy.saveRoles():=
156=A0 - Adding roles [ visit ] to request [org.apache.cocoon.environment.h=
ttp.HttpRequest@2457c24c]<br>
<br>24996 2013-10-12 00:31:35,384 [PoolThread-4] DEBUG lenya.ac.authorizer.=
policy.authorize():111=A0 - Authorized: true<br><br>24996 2013-10-12 00:31:=
35,384 [PoolThread-4] DEBUG lenya.ac.accesscontroller.bypassable.authorize(=
):121=A0 - Authorizer [org.apache.lenya.ac.impl.PolicyAuthorizer@6566aa35] =
returned [true]<br>
<br>24996 2013-10-12 00:31:35,384 [PoolThread-4] DEBUG lenya.ac.accesscontr=
oller.bypassable.authorize():108=A0 - -------------------------------------=
--------------------<br><br>24996 2013-10-12 00:31:35,384 [PoolThread-4] DE=
BUG lenya.ac.accesscontroller.bypassable.authorize():109=A0 - Invoking auth=
orizer [org.apache.lenya.cms.ac.usecase.UsecaseAuthorizer@26456721]<br>
<br>24997 2013-10-12 00:31:35,385 [PoolThread-4] DEBUG lenya.ac.authorizer.=
usecase.authorize():104=A0 - No usecase to authorize. Granting access.<br><=
br>24997 2013-10-12 00:31:35,385 [PoolThread-4] DEBUG lenya.ac.accesscontro=
ller.bypassable.authorize():121=A0 - Authorizer [org.apache.lenya.cms.ac.us=
ecase.UsecaseAuthorizer@26456721] returned [true]<br>
<br>24997 2013-10-12 00:31:35,385 [PoolThread-4] DEBUG lenya.ac.accesscontr=
oller.bypassable.authorize():108=A0 - -------------------------------------=
--------------------<br><br>24997 2013-10-12 00:31:35,385 [PoolThread-4] DE=
BUG lenya.ac.accesscontroller.bypassable.authorize():109=A0 - Invoking auth=
orizer [org.apache.lenya.cms.ac.workflow.WorkflowAuthorizer@7e1b0beb]<br>
<br>24997 2013-10-12 00:31:35,385 [PoolThread-4] DEBUG lenya.ac.authorizer.=
workflow.authorize():69=A0 - Authorizing workflow for event [null]<br><br>2=
4997 2013-10-12 00:31:35,385 [PoolThread-4] DEBUG lenya.ac.accesscontroller=
.bypassable.authorize():121=A0 - Authorizer [org.apache.lenya.cms.ac.workfl=
ow.WorkflowAuthorizer@7e1b0beb] returned [true]<br>
<br>24997 2013-10-12 00:31:35,385 [PoolThread-4] DEBUG lenya.ac.accesscontr=
oller.bypassable.authorize():130=A0 - =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br><br>24997 2=
013-10-12 00:31:35,385 [PoolThread-4] DEBUG lenya.ac.accesscontroller.bypas=
sable.authorize():131=A0 - Authorization complete, result: [true]<br>
<br>24998 2013-10-12 00:31:35,386 [PoolThread-4] DEBUG lenya.ac.accesscontr=
oller.bypassable.authorize():132=A0 - =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br><br>24998 2=
013-10-12 00:31:35,386 [PoolThread-4] DEBUG sitemap.decommission():342=A0 -=
ComponentFactory decommissioning instance of org.apache.lenya.cms.cocoon.a=
cting.DelegatingAuthorizerAction.<br>
<br><br></div></div>
--001a11c3db745bc0d004e8e82cb7--