[GitHub] syncope issue #85: Revert: SYNCOPE-1387 fix class cast exception

2018-10-23 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/85
  
@AlexTsvetkov I have reviewed the code in `DefaultRealmPullResultHandler` 
and found that you were right about removing the additional `after()` calls - 
as proposed in #84 .

This because the `link()` method eventually calls `update()` - thus I have 
tried to clean up a bit the call hierarchy in 
5e854e117594da3a1ba78c0af8d53d89a66a9c5a

Please close this PR as well, sorry for the noise; at least, now the issue 
should be fixed.

For future contributions, please submit an 
[ICLA](http://syncope.apache.org/contributing#How_do_I_become_a_contributor_or_a_committer.3F),
 thanks.


---


[GitHub] syncope issue #84: SYNCOPE-1387 fix class cast exception, remove redundant a...

2018-10-23 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/84
  
That call is *not* redundant, it is invoking the `after()` method with any 
defined push actions.
Please close this PR.


---


[GitHub] syncope issue #83: Kubernetes Install

2018-10-12 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/83
  
Thanks for your contribution: see it on-line at 
https://ci.apache.org/projects/syncope/2_1_X/getting-started.html#kubernetes-sample

As you can see, I did some minor editing and reflow.


---


[GitHub] syncope issue #83: Kubernetes Install

2018-09-20 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/83
  
ping @mornindew 


---


[GitHub] syncope issue #83: Kubernetes Install

2018-09-07 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/83
  
Thanks @mornindew 

Could you please rebase your changes to latest `master` and squash your 
commits into one only? Thanks.

And what about ICLA? Did you submit it?


---


[GitHub] syncope pull request #83: Kubernetes Install

2018-09-02 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/83#discussion_r214544229
  
--- Diff: docker/src/main/resources/k8s/helm/README.adoc ---
@@ -0,0 +1,22 @@
+= Install Commands
+
+Open a terminal and navigate to the "helm" folder.  **REMINDER:  SET YOUR 
VALUES.YAML!!!**
--- End diff --

Please substitute
```
**REMINDER:  SET YOUR VALUES.YAML!!!**
```

with

```
[WARNING]
Do not forget to set your `values.yaml`!
```


---


[GitHub] syncope issue #83: Kubernetes Install

2018-09-02 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/83
  
Please ensure that all new files contain the correct license header, or 
build will fail; for YAML, you can grab it from 
https://github.com/apache/syncope/blob/master/docker/src/main/resources/docker-compose-ha.yml
 - e.g. your YAML files should start with content:

```
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

```


---


[GitHub] syncope issue #83: Kubernetes Install

2018-08-28 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/83
  
Thanks for this PR @mornindew - I'll review it in few days.
Meanwhile: have you already submitted your ICLA? 
http://www.apache.org/licenses/#clas


---


[GitHub] syncope issue #81: [Syncope 1220] Support Groovy implementations in the Netb...

2018-08-14 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/81
  
This PR is for SYNCOPE-1220 (auto-link to JIRA)


---


[GitHub] syncope issue #80: [SYNCOPE-1355] Document how to access services when using...

2018-08-13 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/80
  
The results are available at 
https://ci.apache.org/projects/syncope/2_1_X/getting-started.html#docker-compose-samples
 and will appear at 
https://syncope.apache.org/docs/getting-started.html#docker-compose-samples as 
soon as 2.1.1 is officially released (I expect soon).



---


[GitHub] syncope issue #80: [SYNCOPE-1355] Document how to access services when using...

2018-08-13 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/80
  
Thanks for quick turnaround :+1: 
Please squash your commits and I'll be glad to merge, thanks.


---


[GitHub] syncope issue #80: [SYNCOPE-1355] Document how to access services when using...

2018-08-13 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/80
  
Thanks for your contribution @pfrenssen !
I've added a couple of comments, please address.

Please also consider [sending an 
ICLA](http://syncope.apache.org/contributing#How_do_I_become_a_contributor_or_a_committer.3F),
 thanks.




---


[GitHub] syncope pull request #80: [SYNCOPE-1355] Document how to access services whe...

2018-08-13 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/80#discussion_r209650421
  
--- Diff: src/main/asciidoc/getting-started/obtain.adoc ---
@@ -422,6 +422,23 @@ services:
 <4> Apache Syncope Enduser UI, port `38080` exposed, working with `Master` 
domain
 
 
+How to start the containers:
+
+. Save the example file as `docker-compose.yml` in an empty directory.
+. Download and start the containers:
++
+[source,bash]
+
+$ docker-compose up
+
+
+The following services will be available:
--- End diff --

Please style as in 
https://github.com/apache/syncope/blob/master/src/main/asciidoc/getting-started/obtain.adoc#L259
 e.g. "Components" under "GUI Installer"


---


[GitHub] syncope pull request #80: [SYNCOPE-1355] Document how to access services whe...

2018-08-13 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/80#discussion_r209648695
  
--- Diff: src/main/asciidoc/getting-started/obtain.adoc ---
@@ -422,6 +422,23 @@ services:
 <4> Apache Syncope Enduser UI, port `38080` exposed, working with `Master` 
domain
 
 
+How to start the containers:
+
+. Save the example file as `docker-compose.yml` in an empty directory.
--- End diff --

This step is not required: you could simply do `docker-compose -f `


---


[GitHub] syncope issue #79: Exposed JWT signature algorithm in security.properties. T...

2018-06-28 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/79
  
I have seen:
* you opened SYNCOPE-1328 for this PR
* your new commit, which fixes the build

Could you please squash your two commits into one, preserving the text 
`SYNCOPE-1328` in the final commit message? This will help linking GIT and JIRA.

Since the vote for 2.0.9 is ongoing, I'll merge this PR once that passes.


---


[GitHub] syncope issue #79: Exposed JWT signature algorithm in security.properties. T...

2018-06-27 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/79
  
Hi @noorulrazvi-saal, thanks for this PR!

Before merging, could you please:
1. sign and send an 
[ICLA](http://syncope.apache.org/contributing#How_do_I_become_a_contributor_or_a_committer)
1. open an issue on 
[JIRA](https://issues.apache.org/jira/projects/SYNCOPE?) for such an improvement
1. fix the failing tests (maybe the reason is only the default value for 
algorithm, as pointed in my previous comemnt):
```
[INFO] Running org.apache.syncope.fit.core.JWTITCase
[ERROR] Tests run: 12, Failures: 1, Errors: 2, Skipped: 0, Time elapsed: 
2.75 s <<< FAILURE! - in org.apache.syncope.fit.core.JWTITCase
[ERROR] queryUsingToken  Time elapsed: 0.26 s  <<< ERROR!
java.security.AccessControlException: Invalid signature found in JWT
at 
org.apache.syncope.fit.core.JWTITCase.queryUsingToken(JWTITCase.java:129)
[ERROR] tokenValidation  Time elapsed: 0.14 s  <<< ERROR!
java.security.AccessControlException: Invalid signature found in JWT
at 
org.apache.syncope.fit.core.JWTITCase.tokenValidation(JWTITCase.java:174)
[ERROR] getJWTToken  Time elapsed: 0.246 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected:  but was: 
at org.apache.syncope.fit.core.JWTITCase.getJWTToken(JWTITCase.java:80)
```

Thanks!


---


[GitHub] syncope pull request #79: Exposed JWT signature algorithm in security.proper...

2018-06-27 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/79#discussion_r198392214
  
--- Diff: core/spring/src/main/resources/security.properties ---
@@ -28,6 +28,9 @@ secretKey=${secretKey}
 jwsKey=${jwsKey}
 jwtIssuer=ApacheSyncope
 
+# Algorthim used to create and authenticate access token
+jwtSignAlgo=HS256
--- End diff --

Why `HS256` as default? It used to be `HS512`, no?


---


[GitHub] syncope issue #78: SYNCOPE-1303: fix content migration from 1.2 to 2.0.9-SNA...

2018-06-25 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/78
  
Thanks @loredicola !


---


[GitHub] syncope issue #77: Update Appveyor config to use Maven 3.5.3

2018-06-05 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/77
  
:+1: 


---


[GitHub] syncope issue #77: Update Appveyor config to use Maven 3.5.3

2018-06-04 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/77
  
Thanks @slachiewicz I've just merged this PR: please submit an ICLA for 
your future contributions: 
http://syncope.apache.org/contributing#How_do_I_become_a_contributor_or_a_committer


---


[GitHub] syncope issue #74: [SYNCOPE-1270] implementation for OpenID Connect for Admi...

2018-05-03 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/74
  
Thanks @DimaAy for your changes, they look fine!
Just squash your 3 commits into 1 and I'll gladly merge this PR, thanks.


---


[GitHub] syncope issue #74: [SYNCOPE-1270] implementation for OpenID Connect for Admi...

2018-05-02 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/74
  
Other things for Admin Console: adjust modal window title to match the 
actual name:


![immagine](https://user-images.githubusercontent.com/1064664/39528235-d0bafdd4-4e23-11e8-8b46-b139326116ca.png)



---


[GitHub] syncope issue #74: [SYNCOPE-1270] implementation for OpenID Connect for Admi...

2018-05-02 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/74
  
Thanks @DimaAy the code looks almost complete, and it's also working.

I would just make some enhancements to the Admin Console management:

1. When adding / editing an OIDC provider, validate all values that are 
expected to be URIs *before* saving
1. Move the `Has Discovery Document` flag after `Issuer`
1. When editing an existing ODIC provider, make all the second step's 
fields as read-only, and show them all despite the Discovery Document was used 
during create

Side note: I see there is no yet support for 
[Logout](https://medium.com/@robert.broeckelmann/openid-connect-logout-eccc73df758f),
 which is provided at least by 
[Azure](https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/development/ad-fs-logout-openid-connect),
 maybe you can submit a new PR for that after the current ones gets merged.


---


[GitHub] syncope issue #73: [SYNCOPE-1306] fixing date value without conversion patte...

2018-04-26 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/73
  
LGTM thanks @DimaAy 


---


[GitHub] syncope issue #71: fix content migration from 1.2 to 2.0.9-SNAPSHOT version

2018-04-23 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/71
  
Thx @loredicola I've merged this PR


---


[GitHub] syncope issue #71: fix content migration from 1.2 to 2.0.9-SNAPSHOT version

2018-04-23 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/71
  
SYNCOPE-303 was created to support this PR.


---


[GitHub] syncope pull request #71: fix content migration from 1.2 to 2.0.9-SNAPSHOT v...

2018-04-23 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/71#discussion_r183326763
  
--- Diff: 
client/cli/src/main/java/org/apache/syncope/client/cli/commands/migrate/MigrateConf.java
 ---
@@ -864,9 +885,6 @@ private static void exec(final String src, final String 
dst) throws XMLStreamExc
 reader.next();
 }
 
-writer.writeStartElement("Realm");
-writer.writeAttribute("id", UUID.randomUUID().toString());
-writer.writeAttribute("name", "/");
 if (globalAccountPolicy != null) {
--- End diff --

If you move the Realm creation above, all this block until 
`writer.writeEndElement()` must be moved above too.


---


[GitHub] syncope issue #71: fix content migration from 1.2 to 2.0.9-SNAPSHOT version

2018-04-23 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/71
  
@loredicola please open an issue on JIRA about the fixes you are proposing 
with this PR.

Besides the comment I've added, the rest looks good.
Please revert the aforementioned changes and I'll merge right away.


---


[GitHub] syncope pull request #71: fix content migration from 1.2 to 2.0.9-SNAPSHOT v...

2018-04-23 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/71#discussion_r183312735
  
--- Diff: 
client/cli/src/main/java/org/apache/syncope/client/cli/commands/migrate/MigrateConf.java
 ---
@@ -731,18 +752,18 @@ private static void exec(final String src, final 
String dst) throws XMLStreamExc
 String syncActionClassName = 
getAttributeValue(reader, "element");
 switch (syncActionClassName) {
 case 
"org.apache.syncope.core.sync.impl.LDAPMembershipSyncActions":
-syncActionClassName =
-
"org.apache.syncope.core.provisioning.java.pushpull.LDAPMembershipPullActions";
+syncActionClassName
--- End diff --

Please revert such formatting changes (and similar9


---


[GitHub] syncope issue #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/70
  
> That way replace won't work since it saves first (2 tokens exist.violate 
UNIQUE constraint) and deletes next. That way it will only delete the existing 
one which results in no token at all.

You are right, but as you can see, in the [current 
implementation](https://github.com/apache/syncope/blob/master/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AccessTokenDataBinderImpl.java#L138-L142)
 save and delete do not happen under the same conditions.



---


[GitHub] syncope issue #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/70
  
I would stick with minimal changes, so this PR should only change 
`JPAAccessToken`.


---


[GitHub] syncope issue #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/70
  
Ok so...
> Are you simply proposing to add such constraint and leave the rest of the 
code as is?

e.g. to change again this PR by reverting all changes and adding the UNIQUE 
constraint?


---


[GitHub] syncope issue #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/70
  
@IsurangaPerera the only effect of UNIQUE constraint will be that a 
validation error is raised whenever a second AccessToken is created with same 
owner of an existing one.
Are you simply proposing to add such constraint and leave the rest of the 
code as is?


---


[GitHub] syncope issue #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/70
  
Ok, let's try this way: please re-introduce the UNIQUE constraint but 
rework the whole `AccessTokenDataBinderImpl#create` to comply with the two 
invocation scenarios as reported above.

Do you think it could be feasible?


---


[GitHub] syncope issue #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/70
  
@IsurangaPerera I don't remember the details, but what I can see from the 
source three is that `AccessTokenDataBinderImpl#create` is invoked in two 
places:

1. 
https://github.com/apache/syncope/blob/master/core/logic/src/main/java/org/apache/syncope/core/logic/AccessTokenLogic.java#L84
 (plain login)
1. 
https://github.com/apache/syncope/blob/master/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/SAML2SPLogic.java#L549
 (SAML 2.0 login)

The former provides `replaceExisting` as `false`, the latter as `true`.

From the code in `AccessTokenDataBinderImpl#create` I can see that:

* for plain login, JWT is generated only at first invocation
* for SAML 2.0 login, JWT is generated at every invocation, and existing 
JWT is replaced if existing

Moreover, I cannot recall exactly why the UNIQUE constraint is not imposed 
to AccessToken's `owner`.


---


[GitHub] syncope issue #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/70
  
@IsurangaPerera the point is that the existence of `replaceFlag` (I did not 
realize that at first) is what prevents to enforce the UNIQUE constraint.


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181103559
  
--- Diff: 
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAccessTokenDAO.java
 ---
@@ -115,6 +115,16 @@ public AccessToken save(final AccessToken accessToken) 
{
 return entityManager().merge(accessToken);
 }
 
+@Override
+public AccessToken replace(final AccessToken accessToken) {
+AccessToken existing = findByOwner(accessToken.getOwner());
+if (existing != null) {
+delete(existing.getKey());
+}
+
+return save(accessToken);
--- End diff --

`return replaceExisting ? save(accessToken) : existing;`


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181103181
  
--- Diff: 
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAccessTokenDAO.java
 ---
@@ -115,6 +115,16 @@ public AccessToken save(final AccessToken accessToken) 
{
 return entityManager().merge(accessToken);
 }
 
+@Override
+public AccessToken replace(final AccessToken accessToken) {
+AccessToken existing = findByOwner(accessToken.getOwner());
+if (existing != null) {
--- End diff --

`if (replaceExisting && existing != null) {`


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181102107
  
--- Diff: 
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AccessTokenDataBinderImpl.java
 ---
@@ -135,11 +135,7 @@
 accessToken.setAuthorities(authorities);
 }
 
-accessTokenDAO.save(accessToken);
-}
-
-if (replaceExisting && existing != null) {
-accessTokenDAO.delete(existing);
+accessTokenDAO.merge(accessToken);
--- End diff --

both: remove `unique = true` (e.g. revert all changes there, as said) AND 
keep the same code


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181100854
  
--- Diff: 
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAccessToken.java
 ---
@@ -44,7 +44,7 @@
 @Temporal(TemporalType.TIMESTAMP)
 private Date expiryTime;
 
-@Column(nullable = true)
+@Column(nullable = true, unique = true)
--- End diff --

as said, revert any change here


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181100663
  
--- Diff: 
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAccessTokenDAO.java
 ---
@@ -115,6 +115,16 @@ public AccessToken save(final AccessToken accessToken) 
{
 return entityManager().merge(accessToken);
 }
 
+@Override
+public AccessToken replace(final AccessToken accessToken) {
+AccessToken existing = findByOwner(accessToken.getOwner());
+if (existing != null) {
+delete(existing.getKey());
+}
+
+return entityManager().merge(accessToken);
--- End diff --

replace `entityManager().merge(accessToken)` with `save(accesToken)`


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181100023
  
--- Diff: 
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AccessTokenDataBinderImpl.java
 ---
@@ -135,11 +135,7 @@
 accessToken.setAuthorities(authorities);
 }
 
-accessTokenDAO.save(accessToken);
-}
-
-if (replaceExisting && existing != null) {
-accessTokenDAO.delete(existing);
+accessTokenDAO.merge(accessToken);
--- End diff --

That's why we are not enforcing the unique constraint (hence, NOT changing 
`@Column(nullable = true)`: the `replaceExisting` flag exists for a reason, do 
not alter such behavior as there might be some code relying on it.


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181097338
  
--- Diff: 
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AccessTokenDataBinderImpl.java
 ---
@@ -135,11 +135,7 @@
 accessToken.setAuthorities(authorities);
 }
 
-accessTokenDAO.save(accessToken);
-}
-
-if (replaceExisting && existing != null) {
-accessTokenDAO.delete(existing);
+accessTokenDAO.merge(accessToken);
--- End diff --

To me, it should be enough to pass the `replaceExisting` flag to the new 
`AccessTokenDAO#replace` method, and behave accordingly.


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181096467
  
--- Diff: 
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AccessTokenDataBinderImpl.java
 ---
@@ -135,11 +135,7 @@
 accessToken.setAuthorities(authorities);
 }
 
-accessTokenDAO.save(accessToken);
-}
-
-if (replaceExisting && existing != null) {
-accessTokenDAO.delete(existing);
+accessTokenDAO.merge(accessToken);
--- End diff --

...but there might be cases where such constraint should not apply (see the 
`@Column` annotation we've been discussing).


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181093676
  
--- Diff: 
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAccessTokenDAO.java
 ---
@@ -115,6 +115,16 @@ public AccessToken save(final AccessToken accessToken) 
{
 return entityManager().merge(accessToken);
 }
 
+@Override
+@Transactional(rollbackFor = Throwable.class)
+public void merge(final AccessToken accessToken) {
+AccessToken existing = findByOwner(accessToken.getOwner());
+if (existing != null) {
+entityManager().remove(existing);
+}
+entityManager().persist(accessToken);
--- End diff --

Also, replace `entityManager().remove(existing)` with `delete(existing)`, 
thanks.


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181093708
  
--- Diff: 
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AccessTokenDataBinderImpl.java
 ---
@@ -135,11 +135,7 @@
 accessToken.setAuthorities(authorities);
 }
 
-accessTokenDAO.save(accessToken);
-}
-
-if (replaceExisting && existing != null) {
-accessTokenDAO.delete(existing);
+accessTokenDAO.merge(accessToken);
--- End diff --

So, the current implementation will replace the token only if 
`replaceExisting` is true; with your change, the token will be replaced anyway, 
because `JPAAccessTokenDAO#merge` will do

```
if (existing != null) {
entityManager().remove(existing);
}
```
while the current code does
```
if (replaceExisting && existing != null) {
accessTokenDAO.delete(existing);
}
```


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181091780
  
--- Diff: 
core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AccessTokenDAO.java
 ---
@@ -34,6 +34,8 @@
 
 AccessToken save(AccessToken accessToken);
 
+void merge(AccessToken accessToken);
--- End diff --

maybe `replace()` makes more sense


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181089858
  
--- Diff: 
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAccessToken.java
 ---
@@ -44,7 +44,7 @@
 @Temporal(TemporalType.TIMESTAMP)
 private Date expiryTime;
 
-@Column(nullable = true)
+@Column(unique = true)
--- End diff --

Just revert, I know `nullable = true` is the default, but I don't see 
reasons to change.


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181089640
  
--- Diff: 
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AccessTokenDataBinderImpl.java
 ---
@@ -135,11 +135,7 @@
 accessToken.setAuthorities(authorities);
 }
 
-accessTokenDAO.save(accessToken);
-}
-
-if (replaceExisting && existing != null) {
-accessTokenDAO.delete(existing);
+accessTokenDAO.merge(accessToken);
--- End diff --

`replaceExisting` is an argument of `AccesstTokenDataBinderImpl#create` 
that your change would simply ignore.
Not good: it must be checked.


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181088731
  
--- Diff: 
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAccessToken.java
 ---
@@ -44,7 +44,7 @@
 @Temporal(TemporalType.TIMESTAMP)
 private Date expiryTime;
 
-@Column(nullable = true)
+@Column(unique = true)
--- End diff --

As said during the initial mail exchange, I am not sure of the reason why 
owner is currently set as nullable, and I don't see enough reasons to change 
it, please revert.


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181088154
  
--- Diff: 
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AccessTokenDataBinderImpl.java
 ---
@@ -135,11 +135,7 @@
 accessToken.setAuthorities(authorities);
 }
 
-accessTokenDAO.save(accessToken);
-}
-
-if (replaceExisting && existing != null) {
-accessTokenDAO.delete(existing);
+accessTokenDAO.merge(accessToken);
--- End diff --

what about the `replaceExistingFlag`? You just removed it!


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181087678
  
--- Diff: 
core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AccessTokenDAO.java
 ---
@@ -34,6 +34,8 @@
 
 AccessToken save(AccessToken accessToken);
 
+void merge(AccessToken accessToken);
--- End diff --

Change it into
```
AccessToken merge(AccessToken accessToken);
```


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181087221
  
--- Diff: 
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAccessTokenDAO.java
 ---
@@ -115,6 +115,16 @@ public AccessToken save(final AccessToken accessToken) 
{
 return entityManager().merge(accessToken);
 }
 
+@Override
+@Transactional(rollbackFor = Throwable.class)
+public void merge(final AccessToken accessToken) {
+AccessToken existing = findByOwner(accessToken.getOwner());
+if (existing != null) {
+entityManager().remove(existing);
+}
+entityManager().persist(accessToken);
--- End diff --

replace with `save(accessToken)` and make this method return `AccessToken` 
as `save()` does.


---


[GitHub] syncope pull request #70: [SYNCOPE-1301] fixed

2018-04-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/70#discussion_r181086944
  
--- Diff: 
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAccessTokenDAO.java
 ---
@@ -115,6 +115,16 @@ public AccessToken save(final AccessToken accessToken) 
{
 return entityManager().merge(accessToken);
 }
 
+@Override
+@Transactional(rollbackFor = Throwable.class)
--- End diff --

Please remove this annotation, it is redundant..


---


[GitHub] syncope pull request #:

2018-04-04 Thread ilgrosso
Github user ilgrosso commented on the pull request:


https://github.com/apache/syncope/commit/7b168c142b09c3b03e39f1449211e7ddf026a14d#commitcomment-28411553
  
In 
common/lib/src/main/java/org/apache/syncope/common/lib/search/SearchableFields.java:
In 
common/lib/src/main/java/org/apache/syncope/common/lib/search/SearchableFields.java
 on line 39:
@Dmitriy333 I see your point; maybe we can explicitly allow the sole 
`token!=$null` FIQL condition.
Please open an issue on JIRA and possibly provide a PR to fix that, thanks!


---


[GitHub] syncope issue #61: SYNCOPE-917 Add tutorial/use-case "Configure a database r...

2018-03-21 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/61
  
@clucgdc are you still interested? If not, please close this PR as I don't 
have karma to do that.


---


[GitHub] syncope issue #68: SYNCOPE-1220 Fixing the netbeans plugin

2018-03-16 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/68
  
Thanks for your contribution @rohanjulka19 !
Sorry it took so long: as you can see, I've squashed your commits before 
merging.
Moreover, I've merged the commit to both `master` and `2_0_X` branches (the 
icon was missing in both places as it seems).


---


[GitHub] syncope pull request #68: SYNCOPE-1220 Fixing the netbeans plugin

2018-03-13 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/68#discussion_r174045249
  
--- Diff: ide/netbeans/pom.xml ---
@@ -133,7 +133,6 @@ under the License.
   false
 
   
-  
--- End diff --

Any reason to remove this line?


---


[GitHub] syncope pull request #68: SYNCOPE-1220 Fixing the netbeans plugin

2018-03-13 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/68#discussion_r174040731
  
--- Diff: ide/netbeans/pom.xml ---
@@ -124,7 +124,7 @@ under the License.
 
   
 
-  
+
--- End diff --

No need to open a new PR, just revert this sole change and make a new 
commit: it will be added to this PR.
Once the review is finished, you might be asked to squash all the commits, 
but for the moment it will work like this.


---


[GitHub] syncope pull request #68: SYNCOPE-1220 Fixing the netbeans plugin

2018-03-13 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/68#discussion_r173764200
  
--- Diff: ide/netbeans/pom.xml ---
@@ -124,7 +124,7 @@ under the License.
 
   
 
-  
+
--- End diff --

Please do not change indentation.


---


[GitHub] syncope issue #68: Fixing the netbeans plugin

2018-03-12 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/68
  
Please add the text `[SYNCOPE-1220]` to your commit's message, to link this 
PR's commits to JIRA, thanks.


---


[GitHub] syncope issue #67: Modifiying documentation for netbeans IDE plugin

2018-02-20 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/67
  
np


---


[GitHub] syncope issue #67: Modifiying documentation for netbeans IDE plugin

2018-02-20 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/67
  
Please close this PR, I don't see reasons to merge it.


---


[GitHub] syncope issue #67: Modifiying documentation for netbeans IDE plugin

2018-02-20 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/67
  
Ah, correct it's .nbm indeed: why on earth you have downloaded as ZIP?


---


[GitHub] syncope issue #67: Modifiying documentation for netbeans IDE plugin

2018-02-20 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/67
  
You don't need to "change its extension", you need to unzip it.


---


[GitHub] syncope issue #67: Modifiying documentation for netbeans IDE plugin

2018-02-20 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/67
  
There is no "If the downloaded plugin is in zip format", it *is* in zip 
format, please adjust.

Also, wrap the note into an asciidoctor's `[TIP]` block,


---


[GitHub] syncope issue #65: Correcting errors in the documentation

2018-02-16 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/65
  
> Can you please tell me when the changes will reflect on the site.

I have already requested your changes to be published, but it seems that 
[the ASF CI](https://ci.apache.org/builders/syncope-2_0_X-docs) is somewhat 
stuck.
Once it will be restarted, you will find your changes published at 
https://ci.apache.org/projects/syncope/2_0_X/reference-guide.html

Finally, once the next stable release 2.0.8 will be out, the updated 
content will be published at the standard location 
https://syncope.apache.org/docs/reference-guide.html


---


[GitHub] syncope issue #64: Japanese translation

2018-01-02 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/64
  
Thanks @naofum for your contribution!
I have applied this PR to branches `2_0_X` and `master`, hence Japanese 
translation will be available with next releases 2.0.8 and 2.1.0

Shortly, the [public demo](http://syncope.apache.org/demo.html) will be 
automatically updated; please, take a look to ensure that everything was picked 
up correctly.


---


[GitHub] syncope issue #64: Japanese translation

2018-01-02 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/64
  
I have seen you opened SYNCOPE-1259, thanks!


---


[GitHub] syncope issue #64: Japanese translation

2018-01-01 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/64
  
Ah, I see it's also for Enduser UI, cool! :-)


---


[GitHub] syncope issue #64: Japanese translation

2018-01-01 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/64
  
You can take https://issues.apache.org/jira/browse/SYNCOPE-828 as reference


---


[GitHub] syncope issue #61: SYNCOPE-917 Add tutorial/use-case "Configure a database r...

2017-12-05 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/61
  
No updates during the last three months: shall we close this PR?


---


[GitHub] syncope issue #61: SYNCOPE-917 Add tutorial/use-case "Configure a database r...

2017-09-27 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/61
  
Hey @clucgdc any news?


---


[GitHub] syncope issue #63: When importing users, cannot import more than 200 users.

2017-09-21 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/63
  
Thanks @tlnd-fcurvat !


---


[GitHub] syncope issue #63: When importing users, cannot import more than 200 users.

2017-09-20 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/63
  
I have just seen SYNCOPE-1211 thanks!


---


[GitHub] syncope issue #63: When importing users, cannot import more than 200 users.

2017-09-20 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/63
  
Hi @tlnd-fcurvat thanks for this PR.

The fix looks good and I could merge it straight away, but I'd need first a 
couple of things:

1. you should submit an 
[ICLA](http://syncope.apache.org/contributing.html#How_do_I_become_a_contributor_or_a_committer)
1. you should open an issue on 
[JIRA](https://issues.apache.org/jira/projects/SYNCOPE) and possible reference 
its name (`SYNCOPE-`) in the commit message

Thanks!


---


[GitHub] syncope issue #61: SYNCOPE-917 Add tutorial/use-case "Configure a database r...

2017-08-29 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/61
  
What if you make:

5.1 Working with a database
5.1.1 Configure database resource
5.1.2 Propagate to database resource
5.1.3 Pull from database resource

(and then the same for Active Directory and LDAP)

?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #61: SYNCOPE-917 Add tutorial/use-case "Configure a dat...

2017-08-29 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/61#discussion_r135969624
  
--- Diff: src/main/asciidoc/reference-guide/tutorials/tutorials.adoc ---
@@ -17,9 +17,6 @@
 // under the License.
 //
 == Tutorials
+:hardbreaks:
--- End diff --

`:hardbreaks:`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope issue #61: SYNCOPE-917 Add tutorial/use-case "Configure a database r...

2017-08-29 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/61
  
Just a few minor changes.

How about my comment above:

> I think that, after Resource configuration, you should also include an 
example Pull Task and show an example when users are pulled from the external 
DB or propagated there after create / update.

?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #61: SYNCOPE-917 Add tutorial/use-case "Configure a dat...

2017-08-29 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/61#discussion_r135714121
  
--- Diff: src/main/asciidoc/reference-guide/tutorials/tutorials.adoc ---
@@ -17,9 +17,6 @@
 // under the License.
 //
 == Tutorials
+:hardbreaks:
--- End diff --

This is not needed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #61: SYNCOPE-917 Add tutorial/use-case "Configure a dat...

2017-08-27 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/61#discussion_r135445658
  
--- Diff: 
src/main/asciidoc/reference-guide/tutorials/configdatabaseresource.adoc ---
@@ -0,0 +1,160 @@
+=== Configure a Database resource
+:hardbreaks:
--- End diff --

Sorry, I was meaning the lines from 2 to 11, which start with 
`:hardbreaks:`, until before ` Introduction`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope issue #62: SYNCOPE-1196 add a specific form for binary and encrypted...

2017-08-25 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/62
  
Thanks @loredicola!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #61: SYNCOPE-917 Add tutorial/use-case "Configure a dat...

2017-08-25 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/61#discussion_r135191229
  
--- Diff: src/main/asciidoc/reference-guide/tutorials/tutorials.adoc ---
@@ -0,0 +1,25 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+== Tutorials
+
+include::configdatabaseresource.adoc[]
+
+include::configactivedirectoryresource.adoc[]
--- End diff --

Do not include empty files nor include them yet.
Add them as files and reference here only when available, thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #61: SYNCOPE-917 Add tutorial/use-case "Configure a dat...

2017-08-25 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/61#discussion_r135191006
  
--- Diff: 
src/main/asciidoc/reference-guide/tutorials/configdatabaseresource.adoc ---
@@ -0,0 +1,160 @@
+=== Configure a Database resource
+:hardbreaks:
+
+For Syncope 2.0.x
+
+* Introduction
+* Pre-requisites
+* Configure Database Table connector instance
+* Configure Database Table resource
+* Configure Resource Provision rules
+
+ Introduction
+
+This tutorial shows all the steps needed to configure an external Database 
Table resource identified by the following connection parameters:
+
+[cols="2*"]
+|===
+|Host
+|localhost
+
+|Port
+|3306
+
+|User
+|root
+
+|User password
+|password
+
+|JDBC connection URL
+|jdbc:mysql://localhost:3306/demo
+
+|Database
+|demo
+
+|Table
+|test
+|===
+
+ Pre-requisites
+
+. Download JDBC driver (MySQL JDBC driver in this case) and include it 
into your JEE container classpath.
+
+. Verify that the bundle exists or 
https://cwiki.apache.org/confluence/display/SYNCOPE/Install+connector+bundles[Install
 ConnId Database Table connector bundle]
+
+ Configure Database Table connector instance
+
+The list of all configurable parameters is available at 
https://connid.atlassian.net/wiki/display/BASE/Database+Table[Database Table 
Connector Configuration].
+Use this tutorial as reference for your configuration.
+
+. Open browser and access to the Syncope administration console 
http://host:port/syncope-console
+. Log in with following credentials:
+Username: admin
+Password: password
+. Click on Topology side menu. Notice the Syncope node, and the Connector 
Bundles node connected to the Syncope node.
+. Click on Connector Bundles node. Notice context menu Add new connector.
+
++
+[.text-center]
+image::configdatabaseresource01.jpg[title="Add new connector 
menu",alt="Add new connector menu"]
+
+. Select Add new connector. New connector modal dialog appears.
+
++
+[.text-center]
+image::configdatabaseresource02.jpg[title="Add new connector 
dialog",alt="Add new connector dialog"]
+
++
+Provide Display name.
+Location may be different on your environment
+Bundle: net.tirasa.connid.bundles.db.table
+Version may be different on your environment
+
+. Select Next.
+
++
+[.text-center]
+image::configdatabaseresource03.jpg[title="Add new connector 
continue",alt="Add new connector continue"]
+
++
+Host: localhost
+Port: 3306
+User: root
+User Password: password
+Database: demo
+Table: test
+Key Column: id
+Password Column: password
+JDBC Driver: com.mysql.jdbc.Driver
+JDBC Connection URL: jdbc:mysql://localhost:3306/demo
+Retrieve password: (yes)
+
+. Select Next.
+
++
+[.text-center]
+image::configdatabaseresource04.jpg[title="Add new connector 
continue",alt="Add new connector continue"]
+
++
+Select needed Capabilities. Refer to 
https://cwiki.apache.org/confluence/display/SYNCOPE/Connector+instances#Connectorinstances-Create_new_Connector[Connector
 instance configuration]
--- End diff --

As explained, no wiki links.
Use `connector-instance-details` as explained above.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #61: SYNCOPE-917 Add tutorial/use-case "Configure a dat...

2017-08-25 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/61#discussion_r135190937
  
--- Diff: 
src/main/asciidoc/reference-guide/tutorials/configdatabaseresource.adoc ---
@@ -0,0 +1,160 @@
+=== Configure a Database resource
+:hardbreaks:
+
+For Syncope 2.0.x
+
+* Introduction
+* Pre-requisites
+* Configure Database Table connector instance
+* Configure Database Table resource
+* Configure Resource Provision rules
+
+ Introduction
+
+This tutorial shows all the steps needed to configure an external Database 
Table resource identified by the following connection parameters:
+
+[cols="2*"]
+|===
+|Host
+|localhost
+
+|Port
+|3306
+
+|User
+|root
+
+|User password
+|password
+
+|JDBC connection URL
+|jdbc:mysql://localhost:3306/demo
+
+|Database
+|demo
+
+|Table
+|test
+|===
+
+ Pre-requisites
+
+. Download JDBC driver (MySQL JDBC driver in this case) and include it 
into your JEE container classpath.
+
+. Verify that the bundle exists or 
https://cwiki.apache.org/confluence/display/SYNCOPE/Install+connector+bundles[Install
 ConnId Database Table connector bundle]
+
+ Configure Database Table connector instance
+
+The list of all configurable parameters is available at 
https://connid.atlassian.net/wiki/display/BASE/Database+Table[Database Table 
Connector Configuration].
+Use this tutorial as reference for your configuration.
+
+. Open browser and access to the Syncope administration console 
http://host:port/syncope-console
+. Log in with following credentials:
+Username: admin
+Password: password
+. Click on Topology side menu. Notice the Syncope node, and the Connector 
Bundles node connected to the Syncope node.
+. Click on Connector Bundles node. Notice context menu Add new connector.
+
++
+[.text-center]
+image::configdatabaseresource01.jpg[title="Add new connector 
menu",alt="Add new connector menu"]
+
+. Select Add new connector. New connector modal dialog appears.
+
++
+[.text-center]
+image::configdatabaseresource02.jpg[title="Add new connector 
dialog",alt="Add new connector dialog"]
+
++
+Provide Display name.
+Location may be different on your environment
+Bundle: net.tirasa.connid.bundles.db.table
+Version may be different on your environment
+
+. Select Next.
+
++
+[.text-center]
+image::configdatabaseresource03.jpg[title="Add new connector 
continue",alt="Add new connector continue"]
+
++
+Host: localhost
+Port: 3306
+User: root
+User Password: password
+Database: demo
+Table: test
+Key Column: id
+Password Column: password
+JDBC Driver: com.mysql.jdbc.Driver
+JDBC Connection URL: jdbc:mysql://localhost:3306/demo
+Retrieve password: (yes)
+
+. Select Next.
+
++
+[.text-center]
+image::configdatabaseresource04.jpg[title="Add new connector 
continue",alt="Add new connector continue"]
+
++
+Select needed Capabilities. Refer to 
https://cwiki.apache.org/confluence/display/SYNCOPE/Connector+instances#Connectorinstances-Create_new_Connector[Connector
 instance configuration]
+
+. Select Finish.
+
+ Configure Database Table resource
+
+. Click on newly created Connector. Notice context menu Add new resource / 
Edit connector / Remove connector.
+. Select Add new resource. New resource modal dialog appears.
+
++
+[.text-center]
+image::configdatabaseresource05.jpg[title="Add new resource 
dialog",alt="Add new resource dialog"]
+
++
+Provide Key (Unique name to identify a resource)
+Select needed Propagation actions. Refer to 
http://syncope.apache.org/docs/reference-guide.html#propagationactions[Propagation
 Actions]
--- End diff --

Link as referenced above.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #61: SYNCOPE-917 Add tutorial/use-case "Configure a dat...

2017-08-25 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/61#discussion_r135190717
  
--- Diff: 
src/main/asciidoc/reference-guide/tutorials/configdatabaseresource.adoc ---
@@ -0,0 +1,160 @@
+=== Configure a Database resource
+:hardbreaks:
+
+For Syncope 2.0.x
+
+* Introduction
+* Pre-requisites
+* Configure Database Table connector instance
+* Configure Database Table resource
+* Configure Resource Provision rules
+
+ Introduction
+
+This tutorial shows all the steps needed to configure an external Database 
Table resource identified by the following connection parameters:
+
+[cols="2*"]
+|===
+|Host
+|localhost
+
+|Port
+|3306
+
+|User
+|root
+
+|User password
+|password
+
+|JDBC connection URL
+|jdbc:mysql://localhost:3306/demo
+
+|Database
+|demo
+
+|Table
+|test
+|===
+
+ Pre-requisites
+
+. Download JDBC driver (MySQL JDBC driver in this case) and include it 
into your JEE container classpath.
+
+. Verify that the bundle exists or 
https://cwiki.apache.org/confluence/display/SYNCOPE/Install+connector+bundles[Install
 ConnId Database Table connector bundle]
+
+ Configure Database Table connector instance
+
+The list of all configurable parameters is available at 
https://connid.atlassian.net/wiki/display/BASE/Database+Table[Database Table 
Connector Configuration].
+Use this tutorial as reference for your configuration.
+
+. Open browser and access to the Syncope administration console 
http://host:port/syncope-console
--- End diff --

It should rather be `protocol://host:port/syncope-console`, according to 
the rest of this guide


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #61: SYNCOPE-917 Add tutorial/use-case "Configure a dat...

2017-08-25 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/61#discussion_r135190610
  
--- Diff: 
src/main/asciidoc/reference-guide/tutorials/configdatabaseresource.adoc ---
@@ -0,0 +1,160 @@
+=== Configure a Database resource
+:hardbreaks:
+
+For Syncope 2.0.x
+
+* Introduction
+* Pre-requisites
+* Configure Database Table connector instance
+* Configure Database Table resource
+* Configure Resource Provision rules
+
+ Introduction
+
+This tutorial shows all the steps needed to configure an external Database 
Table resource identified by the following connection parameters:
+
+[cols="2*"]
+|===
+|Host
+|localhost
+
+|Port
+|3306
+
+|User
+|root
+
+|User password
+|password
+
+|JDBC connection URL
+|jdbc:mysql://localhost:3306/demo
+
+|Database
+|demo
+
+|Table
+|test
+|===
+
+ Pre-requisites
+
+. Download JDBC driver (MySQL JDBC driver in this case) and include it 
into your JEE container classpath.
+
+. Verify that the bundle exists or 
https://cwiki.apache.org/confluence/display/SYNCOPE/Install+connector+bundles[Install
 ConnId Database Table connector bundle]
--- End diff --

The docs in the wiki are old, and applies up to Syncope 1.2. You should 
link to other parts of this guide, instead.

This sentence becomes then:
```
Verify that the bundle exists or <<install-connector-bundles,install the 
ConnId Database Table connector bundle>>
```

as 
https://syncope.apache.org/docs/reference-guide.html#install-connector-bundles 
is the target link (the part after `#` is the actual link to use in the 
statement above).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #61: SYNCOPE-917 Add tutorial/use-case "Configure a dat...

2017-08-25 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/61#discussion_r135190201
  
--- Diff: 
src/main/asciidoc/reference-guide/tutorials/configdatabaseresource.adoc ---
@@ -0,0 +1,160 @@
+=== Configure a Database resource
+:hardbreaks:
--- End diff --

There is no need to add such index: AsciiDoctor generates it automatically.
Please remove it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope issue #61: SYNCOPE-917 Add tutorial/use-case "Configure a database r...

2017-08-25 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/61
  
Hi @clucgdc thanks for this PR.
You need to rename all files with JPG (uppercase) extension to jpg 
(lowercase), otherwise when building on non-Windows boxes you'll get the 
following errors:

```
asciidoctor: WARNING: image to embed not found or not readable: 
/home/ilgrosso/work/syncope/syncope2/src/main/asciidoc/images/configdatabaseresource04.jpg
asciidoctor: WARNING: image to embed not found or not readable: 
/home/ilgrosso/work/syncope/syncope2/src/main/asciidoc/images/configdatabaseresource05.jpg
asciidoctor: WARNING: image to embed not found or not readable: 
/home/ilgrosso/work/syncope/syncope2/src/main/asciidoc/images/configdatabaseresource06.jpg
asciidoctor: WARNING: image to embed not found or not readable: 
/home/ilgrosso/work/syncope/syncope2/src/main/asciidoc/images/configdatabaseresource07.jpg
asciidoctor: WARNING: image to embed not found or not readable: 
/home/ilgrosso/work/syncope/syncope2/src/main/asciidoc/images/configdatabaseresource08.jpg
asciidoctor: WARNING: image to embed not found or not readable: 
/home/ilgrosso/work/syncope/syncope2/src/main/asciidoc/images/configdatabaseresource09.jpg
asciidoctor: WARNING: image to embed not found or not readable: 
/home/ilgrosso/work/syncope/syncope2/src/main/asciidoc/images/configdatabaseresource10.jpg
```

Please note that for the fix above and other observation during review, you 
should not close this PR and open a new one (as you did with #60): just keep 
committing and pushing on your own fork, and new commits will be added here.
Once the review will be successfully completed, I'll ask you to squash the 
commits to keep our history clear.

Thank you again!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #60: SYNCOPE-917 Add tutorial/use-case "Configure a dat...

2017-08-24 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/60#discussion_r134943352
  
--- Diff: nbactions.xml ---
@@ -0,0 +1,15 @@
+
--- End diff --

Please do not include this file in the PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope issue #59: SYNCOPE-1197 SAML label inserted and combo moved below lo...

2017-08-18 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/59
  
Thanks @loredicola for this PR


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope issue #56: [SYNCOPE-1151] Realm is correctly loaded after creation -...

2017-07-14 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/56
  
Thanks again @mat-ale 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope issue #54: Realm is correctly loaded after creation in Admin Console...

2017-07-13 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/54
  
LGTM just merged, thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope issue #50: Connector and Resource configuration versioning in Admin ...

2017-07-13 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/50
  
Merged, thanks @mat-ale!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope issue #53: Keep resource provision list order after editing for SYNC...

2017-07-13 Thread ilgrosso
Github user ilgrosso commented on the issue:

https://github.com/apache/syncope/pull/53
  
Thanks @mat-ale LGTM, please squash your commits and I'll gladly merge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #52: [SYNCOPE-1144] configurable audit appenders with m...

2017-07-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/52#discussion_r126943860
  
--- Diff: fit/core-reference/src/main/resources/log.properties ---
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
--- End diff --

Hum, that'd be even worse, and I don't think that the proposed change would 
resolve to the same file...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #52: [SYNCOPE-1144] configurable audit appenders with m...

2017-07-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/52#discussion_r126937714
  
--- Diff: fit/core-reference/src/main/resources/log.properties ---
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
--- End diff --

Only, be sure that such file is not included by archetype, deb, standalone 
or any other artifact relying on fit/core-reference.
If possible, try to avoid adding such file.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #52: [SYNCOPE-1144] configurable audit appenders with m...

2017-07-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/52#discussion_r126937429
  
--- Diff: fit/core-reference/src/main/resources/log.properties ---
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
--- End diff --

Understand, thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #52: [SYNCOPE-1144] configurable audit appenders with m...

2017-07-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/52#discussion_r126933973
  
--- Diff: 
core/logic/src/main/java/org/apache/syncope/core/logic/AuditAppender.java ---
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.logic;
+
+import java.util.Set;
+import org.apache.logging.log4j.core.Appender;
+import org.apache.logging.log4j.core.appender.rewrite.RewriteAppender;
+import org.apache.logging.log4j.core.appender.rewrite.RewritePolicy;
+import org.apache.syncope.common.lib.types.AuditLoggerName;
+
+public interface AuditAppender {
--- End diff --

Some Javadoc here won't hurt..


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #52: [SYNCOPE-1144] configurable audit appenders with m...

2017-07-12 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/52#discussion_r126933815
  
--- Diff: 
core/logic/src/main/java/org/apache/syncope/core/logic/LoggerLogic.java ---
@@ -216,10 +228,71 @@ private LoggerTO setLevel(final String name, final 
Level level, final LoggerType
 syncopeLogger.setLevel(LoggerLevel.fromLevel(level));
 syncopeLogger = loggerDAO.save(syncopeLogger);
 
+boolean isAudit = LoggerType.AUDIT.equals(syncopeLogger.getType());
 LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
+String domainAuditLoggerName =
+
AuditManagerImpl.getDomainAuditEventLoggerName(AuthContextUtils.getDomain(), 
syncopeLogger.
+getKey());
 LoggerConfig logConf = SyncopeConstants.ROOT_LOGGER.equals(name)
 ? 
ctx.getConfiguration().getLoggerConfig(LogManager.ROOT_LOGGER_NAME)
-: ctx.getConfiguration().getLoggerConfig(name);
+: isAudit
+? 
ctx.getConfiguration().getLoggerConfig(domainAuditLoggerName)
+: ctx.getConfiguration().getLoggerConfig(name);
+
+if (isAudit) {
+// SYNCOPE-1144 For each custom audit appender class add 
related appenders to log4j logger
--- End diff --

Isn't this code a copy of what inserted in `LoggerLoader`? If so, please 
extract it into a public method in `LoggerLoader` and invoke that from here too.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


  1   2   3   4   >