.. _rest_security: Security ======== The REST API allows you to adjust GeoServer security settings. .. note:: Read the :api:`API reference for /security `. Listing the master password --------------------------- **Retrieve the master password for the "root" account** *Request* .. admonition:: curl :: curl -v -u admin:geoserver -XGET http://localhost:8080/geoserver/rest/security/masterpw.xml Changing the master password ---------------------------- **Change to a new master password** .. note:: Requires knowledge of the current master password. Given a ``changes.xml`` file: .. code-block:: xml -"}3a^Kh geoserver1 *Request* .. admonition:: curl :: curl -v -u admin:geoserver -XPUT -H "Content-type: text/xml" -d @change.xml http://localhost:8080/geoserver/rest/security/masterpw.xml *Response* :: 200 OK Listing the catalog mode ------------------------ **Fetch the current catalog mode** *Request* .. admonition:: curl :: curl -v -u admin:geoserver -XGET http://localhost:8080/geoserver/rest/security/acl/catalog.xml *Response* .. code-block:: xml HIDE Changing the catalog mode ------------------------- **Set a new catalog mode** Given a ``newMode.xml`` file: .. code-block:: xml MIXED *Request* .. admonition:: curl :: curl -v -u admin:geoserver -XPUT -H "Content-type: text/xml" -d @newMode.xml http://localhost:8080/geoserver/rest/security/acl/catalog.xml Listing access control rules ---------------------------- **Retrieve current list of access control rules** *Request* .. admonition:: curl :: curl -v -u admin:geoserver -XGET http://localhost:8080/geoserver/rest/security/acl/layers.xml *Response* .. code-block:: xml .. note:: The above response shows no rules specified. Changing access control rules ----------------------------- **Set a new list of access control rules** Given a ``rules.xml`` file: .. code-block:: xml ROLE_AUTHORIZED ROLE_1,ROLE_2 *Request* .. admonition:: curl :: curl -v -u admin:geoserver -XPOST -H "Content-type: text/xml" -d @rules.xml http://localhost:8080/geoserver/rest/security/acl/layers.xml *Response* :: 201 Created Deleting access control rules ----------------------------- **Delete individual access control rule** *Request* .. admonition:: curl :: curl -v -u admin:geoserver -XDELETE http://localhost:8080/geoserver/rest/security/acl/layers/topp.*.r *Response* :: 200 OK