Monday May 14, 2007 | cn=Directory Manager All about Directory Server |
The OpenDS Virtual Attribute SubsystemOne of the key OpenDS components that makes virtual static groups possible is the virtual attribute subsystem. Virtual attributes are those attributes whose values are computed on the fly rather than actually being stored in the database. There are a number of uses for virtual attributes in the server, and there is an API (org.opends.server.api.VirtualAttributeProvider) that can be used to create new types of virtual attributes.
Some of the virtual attribute providers we have defined in OpenDS include:
Virtual Attribute ConfigurationVirtual attributes are configured below "cn=Virtual Attributes,cn=config". These entries need to have the ds-cfg-virtual-attribute object class, which requires the following attributes:
With only the above configuration attributes, the virtual attribute may be generated for all entries. If you wish to pare down the set of entries in which the virtual attribute may be present, you can use one or more of the additional configuration attributes (all of which are multivalued):
User-Defined Virtual AttributesUser-defined virtual attributes can be used to supply specific administrator-supplied values to entries matching the virtual attribute criteria. The net effect is essentially the same as what you can get using the Class of Service (CoS) capabilities of the Sun Java System Directory Server, but I think that the implementation and configuration is much more straightforward (although I may be a bit biased since I wrote the code).In order to create a user-defined virtual attribute, add a new entry to the server configuration. It should contain the ds-cfg-user-defined-virtual-attribute object class (which extends the ds-cfg-virtual-attribute class and therefore takes all of the configuration attributes that it uses as described above), and it should also have at least one value for the ds-cfg-virtual-attribute-value attribute to specify the value that entries matching the criteria should be given. The ds-cfg-virtual-attribute-class should be set to " org.opends.server.extensions.UserDefinedVirtualAttributeProvider".
For example, the following configuration entry assigns a default postalCode value for everyone in the Austin office (although if they already have a postalCode value in their entry, it will be used instead of the virtual value): dn: cn=Austin postalCode,cn=Virtual Attributes,cn=config objectClass: top objectClass: ds-cfg-virtual-attribute objectClass: ds-cfg-user-defined-virtual-attribute cn: Austin postalCode ds-cfg-virtual-attribute-class: org.opends.server.extensions.UserDefinedVirtualAttributeProvider ds-cfg-virtual-attribute-enabled: true ds-cfg-virtual-attribute-type: postalCode ds-cfg-virtual-attribute-value: 78727 ds-cfg-virtual-attribute-conflict-behavior: real-overrides-virtual ds-cfg-virtual-attribute-base-dn: ou=People,dc=example,dc=com ds-cfg-virtual-attribute-filter: (&(l=Austin)(st=Texas)) Note that because of the way that virtual attributes are implemented in OpenDS, you can use them to supply values for pretty much any kind of attribute, including operational attributes. For example, you could use it to set the ds-pwp-password-policy-dn operational attribute to give users a custom password policy, ds-rlim-size-limit to define a custom size limit, or ds-privilege-name to assign one or more privileges. For example, the following virtual attribute configuration entry gives a special set of privileges to everyone on the "Administrators" group: Posted by cn_equals_directory_manager ( May 14 2007, 01:31:47 PM CDT ) Permalinkdn: cn=Administrator Privileges,cn=Virtual Attributes,cn=config objectClass: top objectClass: ds-cfg-virtual-attribute objectClass: ds-cfg-user-defined-virtual-attribute cn: Administrator Privileges ds-cfg-virtual-attribute-class: org.opends.server.extensions.UserDefinedVirtualAttributeProvider ds-cfg-virtual-attribute-enabled: true ds-cfg-virtual-attribute-type: ds-privilege-name ds-cfg-virtual-attribute-value: modify-acl ds-cfg-virtual-attribute-value: config-read ds-cfg-virtual-attribute-value: config-write ds-cfg-virtual-attribute-value: ldif-import ds-cfg-virtual-attribute-value: ldif-export ds-cfg-virtual-attribute-value: backend-backup ds-cfg-virtual-attribute-value: backend-restore ds-cfg-virtual-attribute-value: password-reset ds-cfg-virtual-attribute-value: update-schema ds-cfg-virtual-attribute-conflict-behavior: merge-real-and-virtual ds-cfg-virtual-attribute-group-dn: cn=Administrators,ou=Groups,dc=example,dc=com Comments:
Post a Comment: Comments are closed for this entry. |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||