postgresql/src/test/modules/dummy_seclabel
Peter Eisentraut 8b9e9644dc Replace AclObjectKind with ObjectType
AclObjectKind was basically just another enumeration for object types,
and we already have a preferred one for that.  It's only used in
aclcheck_error.  By using ObjectType instead, we can also give some more
precise error messages, for example "index" instead of "relation".

Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
2018-01-19 14:01:15 -05:00
..
expected Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
sql Rework the options syntax for logical replication commands 2017-05-12 08:57:49 -04:00
.gitignore dummy_seclabel: add sql/, expected/, and .gitignores 2014-12-02 11:14:56 -03:00
dummy_seclabel--1.0.sql Fix whitespace 2014-12-02 23:45:03 -05:00
dummy_seclabel.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
dummy_seclabel.control Install kludges to fix check-world for src/test/modules 2014-12-02 23:43:53 -03:00
Makefile Remove erroneous EXTRA_CLEAN line from Makefile. 2014-12-05 12:17:56 +02:00
README Move test modules from contrib to src/test/modules 2014-11-29 23:55:00 -03:00

The dummy_seclabel module exists only to support regression
testing of the SECURITY LABEL statement.  It is not intended
to be used in production.

Rationale
=========

The SECURITY LABEL statement allows the user to assign security
labels to database objects; however, security labels can only be assigned
when specifically allowed by a loadable module, so this module is provided
to allow proper regression testing.

Security label providers intended to be used in production will typically be
dependent on a platform-specific feature such as
SE-Linux.  This module is platform-independent,
and therefore better-suited to regression testing.

Usage
=====

Here's a simple example of usage:

# postgresql.conf
shared_preload_libraries = 'dummy_seclabel'

postgres=# CREATE TABLE t (a int, b text);
CREATE TABLE
postgres=# SECURITY LABEL ON TABLE t IS 'classified';
SECURITY LABEL

The dummy_seclabel module provides only four hardcoded
labels: unclassified, classified,
secret, and top secret.
It does not allow any other strings as security labels.

These labels are not used to enforce access controls.  They are only used
to check whether the SECURITY LABEL statement works as expected,
or not.

Author
======

KaiGai Kohei <kaigai@ak.jp.nec.com>