How to create "dynamic group" in ldap? - ldap

I want to create dynamic group in openldap with Apache Directory Studio but groupOfURLs object class not available.

The dynamic group feature is not present by default (that's why you can't find the groupOfURLs object class). You need to define and add the dyngroup.schema to cn=config.
The dyngroup definition can be found here : dyngroup.ldif
Then, for the dynamic group feature to work, you need to enable the dynlist overlay, which also need to be defined, see slapo-dynlist.
You can refer to this issue as a kind of walk through.

Related

How to do right rest api update?

I am developing rest api update method for user profile resource user/profile. I am disappointed what http method should i use. Update contains some required attributes so it more PUT request, where client need to fill all attributes. But how it can extend attributes in future. If i will decide to add new attribute then it will automatically clear because client is not implement it yet.
But what if this new attribute has default value or is set by another route?
Can i use PUT with not stricting number of attributes and use old data if new isn't come in request. Or how it can be done normally?
HTTP is an application whose application domain is the transfer of documents over a network -- Webber, 2011.
PUT is the appropriate method to use when "saving" a new version of a document onto a web server.
how it can extend attributes in future.
You design your schemas to be forward and backward compatible; in practice, what this means is that you can add new optional elements with reasonable default values. When you need to add a new required element, you change the name of the schema.
You'll find prior art in this topic by searching XML literature for must ignore.
You understand correctly: PUT is for complete replacement, so values that you don't include would be lost.
Instead, use the PATCH method, which is for making partial updates. You can update only the properties you include values for.

How to implement IAuthorizationServiceEventHandler in Orchard CMS?

I have difficulties with the implementation of IAuthorizationServiceEventHandler in Orchard CMS.
The issue here is that i want to check for specific permissions (permissions defined by my module) but the parameters of the handler methods (type Orchard.Security.CheckAccessContext) do not provide the feature name of the permission being checked.
Why is that so or is this a bug?
Surely i can name my permission like MyModuleName.PermissionName or use another type of name encoding but i think this is not practical as we already have the feature name linked to the permission in the DB for example.
Hmm, after reconsidering my approach and watching the call stack the issue is no more an issue.
My question was based on the thinking that i need to compare aContext.Permission.Name provided by e.g. IAuthorizationServiceEventHandler.Complete() with the permission names of my module.
But since the instance aContext.Permission provided by by e.g. IAuthorizationServiceEventHandler.Complete() is the instance passed to the related IAuthorizationService.TryCheckAccess() call i can do a simple comparison like
if (aContext.Permission == MyModule.Permission.PermissionA) { ... }
and it works because both instances have the same pointer address.

Syntax of Local.Properties In Hybris

I know that local.Properties overrides project.Properties.
I also know that that these files define… database connections, ports, build environment, frontend HTTPS, etc.
I further know that project.Properties contains more properties.
Will appreciate if Hybris experts tell me syntax of local.Properties, illustrating with some example.
Please provide correct info.
If we talk about the syntaxes of entries in the project.properties file, then it is key=value
The property files in the hybris are of two types:
The extension level - The property file project.properties is the configuration file that carries properties in the key-value pair for the configurations involved on the extension level For instance, Consider a property in the project.properties of the yacceleratorstorefront (storefront template) extension storefront.storelocator.pageSize.Desktop=10 which clearly indicates the 'StoreLocator' results page size configuration per store. Since the store locator functionality is specific to the storefront and has no relevance for the other modules (like core, facades etc), the property is kept at the extension level.
Please note, project.properties reside in the extension folder
The global level - This is the property file which is the global configuration file, and deals with the properties are extension agnostic and carry a global impact. For instance the property commerceservices.default.desktop.ui.experience=responsive sets the ui experience to responsive mode that specifies the deployment to be for the responsive format.
The local.property file supersedes all of the properties with the same key that is defined in any of the project.proprties.
Please note, the local.properties file reside in the hybris/config folder
The hybris registry creates a property configuration map which constitutes all of the properties mentioned in the deployment configuration. The same could be managed in the HAC under platform/configuration.
The clear intent of the local.proprties file is to have information which either requires to be overriden on a global level. The override may be of different types, e.g. cart expiry time could be made different on different environments by the use of the local.property files.
For further reading, please refer to the link: https://wiki.hybris.com/display/release5/Configuring+the+Behavior+of+the+hybris+Commerce+Suite
property call hierarchy (from primary to secondary):
java -Dproperty.key=something
hybris/config/local.properties
hybris/*/(extension-name)/project.properties
hybris/bin/platform/project.properties
and within java code:
configService.getString("property.key", "last fallback value, if no propertyfile provide this key");
You could review all current variables using the hac interface for properties: http://localhost:9001/platform/config

Setting Domain Credential during WebLogic WLST offline domain creation?

I have successfully created WLS 10.3.5 domains using offline WLST, along the lines of readTemplate(template); set("name","DomainName"); ...
One detail remains: I need to set the "Credential" of each domain to a common random value, across all domains, for "global trust". It's the setting that's behind Console / Domain / Security / General / Advanced / "Credential"
Question: I fail to find the property (or its location?) that one needs to set for this?
FWIW, I use post-processing on config.xml file level now to inject an encrypted common value string as <credential-encrypted> , but I'd rather just set this via WLST without tweaking the resulting XML.
Thanks in advance,
Matthias
I suggest you to use createDomain() command it will be much easy to work.
createDomain('/olddoamin/path/template.jar’,’domainPath’,’user’, ‘passwd’)
For more you can see the following link:
WLST by Examples: Domain migration made simple
As you told your navigation on the console, I found on WLST navigation property location it is having in the followingpath:
wls:/offline/mydomain/SecurityConfiguration/mydomain>ls()
-rw- CredentialEncrypted ????????
It is with -rw- so you can update it right?
Hope this will help you.
Right, this works. The key is to not work on the template, but to read the doman from its domain directory. Then it's just setting the attribute CredentialEncrypted:
readDomain(domain_dir)
cd('/SecurityConfiguration/' + 'domain_name)
set('CredentialEncrypted', encrypt(shared_credential,domain_dir))
updateDomain()
closeDomain()
shared_credential should be something random. I used a hex-encoded digest of the newly-created config.xml file, which contains enough randomness.

property qualified-name in method getContentReader

I first apologize for my poor english level and maybe for the stupidity of my question ;)
I am on an alfresco project to learn how it works.
I have to browse programatically my content repository and gather datas all along. In order to do that I guessed I had to use a ContentReader (I get from my ContentService) but the method getReader wants a nodeRef and a propertyQualifiedName.
I am ok with the nodeRef, I get what it's needed for.
But the propertyQualifiedName puzzles me, I barely get what it is but I frankly don't get how it is used.
Reading some alfresco forum threads I get more and more scared that I dont even get how a reader works, I somewhere saw that a reader can read only one node and only one time per instance.
If anyone knows a bit about the Java API for Alfresco Content Repository use I am all hears !
Cheers all !
ContentReader is a wrapper class for the content of a given property of a node. So, in order to get an instance of ContentReader you'll have to give the node from which you the property from and the property qualified name.
As for the qualified name, every node property is identified by the conjunction of two string values:
The property namespace. Usually an uri like "http://www.alfresco.org/model/content/1.0"
The property local name. Usually a simple string like "created".
These two values put together constitute the property qualified name. There are constants defined for most standard properties of the alfresco model in the org.alfresco.model.ContentModel interface. For example, to get the creator of a node you would do something like:
contentService.getReader(myNode, ContentModel.PROP_CREATOR).getContentString();