Skip to content

Instantly share code, notes, and snippets.

View ilgrosso's full-sized avatar

Francesco Chicchiriccò ilgrosso

View GitHub Profile
@ilgrosso
ilgrosso / DecodeGuardedString.java
Created August 30, 2013 12:26
Briefly shows how to get the actual clear-text password out of a ConnId's GuardedString
// encrypted password is in encPwd
GuardedString encPwd = ...;
final StringBuilder clearPwd = new StringBuilder();
encPwd.access(new GuardedString.Accessor() {
@Override
public void access(final char[] clearChars) {
clearPwd.append(clearChars);
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":[]}
--------------------------------------

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:

@ilgrosso
ilgrosso / Olingo4V3FunctionImportInvoke.java
Last active August 29, 2015 13:58
Invoking V3 FunctionImport via Olingo4 client library
Edm edm = getClient().getRetrieveRequestFactory().
getMetadataRequest(testStaticServiceRootURL).execute().getBody();
EdmFunction func = edm.getUnboundFunction("GetPrimitiveString", null);
EdmEntityContainer container = edm.getSchemas().get(0).getEntityContainer();
URIBuilder builder = getClient().getURIBuilder(testStaticServiceRootURL).
appendOperationCallSegment(URIUtils.operationImportURISegment(container, func.getName()));
ODataProperty property = getClient().getInvokeRequestFactory().