[Geoserver-devel] GEOS-9108

Greetings,

Does there exist a unit test, in which the below bug can be reproduced?

https://osgeo-org.atlassian.net/browse/GEOS-9108

regards,
Imran

···

I.R

Hi Imran,
you mean, a class where you can add the new test that will reproduce the issue?
I don’t think there is one, but the setup would be similar to this class and its two subclasses:
https://github.com/geoserver/geoserver/blob/33afb6b89fc75b78d9ac67fc43da9e069a92babd/src/web/core/src/test/java/org/geoserver/web/admin/AbstractAdminPrivilegeTest.java#L48

However, I believe the setup should be reproduced in the service GUI modules, e.g., gs-web-wms module,
gs-wfs-web module, and so on, because that’s where the service configuration pages live
(in other words, what you want to test against)

Cheers
Andrea

···

Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Hi Andrea,
I am trying to mock the request

http://localhost:8080/geoserver/web/wicket/bookmarkable/org.geoserver.web.data.workspace.WorkspaceEditPage?5&name=secured

against a mock session of the user being denied access. I recon it has something to do with FilterChain for a start.

regards,
Imran

···

I.R

Hi Imran,
it’s a possibility but none of the other GUI tests are using mock requests, as far as I remember.
Double check what the test classes I pointed at do, using WicketTester instead

Cheers
Andrea

···

Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Hi,

So I have just added a new test inside the AdminPrivilegesTest, and the tests have reproduced the problem

@Test
public void testWmsAdminPage() throws Exception {
loginAsCite(); //fails when logged in as workspace admin
login(); //passes when logged in as system admin
tester.startPage(WMSAdminPage.class, new PageParameters().add(“name”, “cite”));
tester.assertRenderedPage(WMSAdminPage.class);
tester.assertNoErrorMessage();
}

regards,
Imran

···

I.R