Skip to content

Instantly share code, notes, and snippets.

Avatar

Francesco Chicchiriccò ilgrosso

View GitHub Profile
@ilgrosso
ilgrosso / ReplacingMavenReleasePlugin.md
Last active Jul 16, 2021
Apache Syncope's release process changes since maven-release-plugin does not work anymore
View ReplacingMavenReleasePlugin.md

During the release process for Apache Syncope 2.1.9 I noticed that release:prepare was not advancing POM version from 2.1.9-SNAPSHOT to 2.1.9, nor it was creating the syncope-2.1.9 tag.

Waiting to understand the reason, I was able to replace the actions peformed by release:prepare and release:perform with the following.

Release prepare

Plugin steps: http://maven.apache.org/maven-release/maven-release-plugin/examples/prepare-release.html

Change version to 2.1.9

@ilgrosso
ilgrosso / AttributesEnrichingPropagationActions.java
Last active Feb 24, 2020
AttributesEnrichingPropagationActions
View AttributesEnrichingPropagationActions.java
public class AttributesEnrichingPropagationAction implements PropagationActions {
@Autowired
private UserDAO userDAO;
@Transactional(readonly = true)
@Override
public void before(final PropagationTask task, final ConnectorObject beforeObj) {
// do something only if propagating users
if (AnyTypeKind.USER == task.getAnyTypeKind()) {
@ilgrosso
ilgrosso / LdapIncrementalPullCorrelationRule.java
Last active Sep 25, 2019
LdapIncrementalPullCorrelationRule
View LdapIncrementalPullCorrelationRule.java
import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.core.persistence.api.dao.PullCorrelationRule;
import org.apache.syncope.core.persistence.api.dao.search.AttributeCond;
import org.apache.syncope.core.persistence.api.dao.search.SearchCond;
import org.apache.syncope.core.persistence.api.entity.resource.Provision;
import org.identityconnectors.framework.common.objects.SyncDelta;
public class GFSLdapPullRule implements PullCorrelationRule {
@Override
@ilgrosso
ilgrosso / FirefoxOnDocker.md
Last active Aug 16, 2019
Firefox on Docker
View FirefoxOnDocker.md
@ilgrosso
ilgrosso / WicketPlugin.java
Created Jul 16, 2018
Hotswap: tentative Wicket plugin
View WicketPlugin.java
import java.lang.reflect.Method;
import org.hotswap.agent.annotation.Init;
import org.hotswap.agent.annotation.OnClassLoadEvent;
import org.hotswap.agent.annotation.OnResourceFileEvent;
import org.hotswap.agent.annotation.Plugin;
import org.hotswap.agent.command.Scheduler;
import org.hotswap.agent.javassist.CannotCompileException;
import org.hotswap.agent.javassist.CtClass;
import org.hotswap.agent.javassist.NotFoundException;
import org.hotswap.agent.logging.AgentLogger;
View SYNCOPE-956 PullJobDelegate sample.java
List<PullActions> actions = new ArrayList<>();
for (String className : pullTask.getActionsClassNames()) {
try {
PullActions pullActions;
if (className.indexOf('.') == -1) {
ExtensionScript script = null; // suppose to fetch it using className as key
ScriptEngine engine = new ScriptEngineManager().getEngineByName("nashorn");
engine.eval(new InputStreamReader(script.getContent()));
View JSPullActions.java
package org.apache.syncope.core.provisioning.java.pushpull;
import javax.script.Bindings;
import javax.script.Invocable;
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptException;
import javax.script.SimpleBindings;
import org.apache.syncope.common.lib.patch.AnyPatch;
import org.apache.syncope.common.lib.to.AnyTO;
View Apache Syncope - Get all groups for user.java
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.Transformer;
import org.apache.commons.collections4.list.SetUniqueList;
// Given this user...
UserTO userTO = ...
List<String> groupKeys = SetUniqueList.setUniqueList(new ArrayList<String>());
// First statically assigned groups...
View gist:36f7aae320dda02e67d4
set 04, 2015 4:14:03 PM org.apache.cxf.interceptor.LoggingOutInterceptor
INFORMAZIONI: Outbound Message
---------------------------
ID: 1
Address: http://localhost:9080/syncope/rest/policies
Http-Method: POST
Content-Type: application/json
Headers: {Content-Type=[application/json], Accept=[application/json], Authorization=[Basic YWRtaW46cGFzc3dvcmQ=]}
Payload: {"@class":"org.apache.syncope.common.lib.policy.AccountPolicyTO","key":0,"description":"Account Policy with custom rules","type":"ACCOUNT","propagateSuspension":false,"maxAuthenticationAttempts":0,"usedByResources":[],"usedByRealms":[],"ruleConfs":[{"@class":"net.tirasa.blog.ilgrosso.syncopecustompolicyrules.common.CustomAccountRuleConf","name":"net.tirasa.blog.ilgrosso.syncopecustompolicyrules.common.CustomAccountRuleConf","requiredSubString":"tralallallero"}],"resources":[]}
--------------------------------------
View keybase.md

Keybase proof

I hereby claim:

  • I am ilgrosso on github.
  • I am ilgrosso (https://keybase.io/ilgrosso) on keybase.
  • I have a public key whose fingerprint is 6F62 BD06 FCE8 4D77 4248 4EBC 6B43 13ED 273D F287

To claim this, I am signing this object: