You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by ad...@apache.org on 2016/09/13 10:53:31 UTC

wicket git commit: Improved synchronization for signIn. Added missing header license.

Repository: wicket
Updated Branches:
  refs/heads/WICKET-6242-authenticate-once 56f947ee5 -> bd365da40


Improved synchronization for signIn. Added missing header license.

Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/bd365da4
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/bd365da4
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/bd365da4

Branch: refs/heads/WICKET-6242-authenticate-once
Commit: bd365da409165093bbae52f51139419cc6e43ab3
Parents: 56f947e
Author: Andrea Del Bene <ad...@apache.org>
Authored: Tue Sep 13 12:37:59 2016 +0200
Committer: Andrea Del Bene <ad...@apache.org>
Committed: Tue Sep 13 12:37:59 2016 +0200

----------------------------------------------------------------------
 .../authentication/AuthenticatedWebSession.java     | 14 ++++----------
 .../authentication/AuthenticatedWebSessionTest.java | 16 ++++++++++++++++
 2 files changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/bd365da4/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java
----------------------------------------------------------------------
diff --git a/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java b/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java
index f0b450c..f11d718 100644
--- a/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java
+++ b/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java
@@ -63,17 +63,11 @@ public abstract class AuthenticatedWebSession extends AbstractAuthenticatedWebSe
 	 */
 	public final boolean signIn(final String username, final String password)
 	{
-		if (signedIn.compareAndSet(false, true))
+		boolean authenticated = authenticate(username, password);
+
+		if (authenticated && signedIn.compareAndSet(false, true))
 		{
-			boolean authenticated = authenticate(username, password);
-			if (authenticated)
-			{
-				bind();
-			}
-			else
-			{
-				signedIn.set(false);
-			}
+			bind();
 		}
 		return signedIn.get();
 	}

http://git-wip-us.apache.org/repos/asf/wicket/blob/bd365da4/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSessionTest.java
----------------------------------------------------------------------
diff --git a/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSessionTest.java b/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSessionTest.java
index c444d81..d91dd9d 100644
--- a/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSessionTest.java
+++ b/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSessionTest.java
@@ -1,3 +1,19 @@
+/*
+ * 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.wicket.authroles.authentication;
 
 import static java.util.Locale.getDefault;


Re: wicket git commit: Improved synchronization for signIn. Added missing header license.

Posted by Martin Grigorov <mg...@apache.org>.
Hi Andrea,

You can still fix it in the branch.
git rebase -i the-previous-hash

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Sep 13, 2016 at 12:54 PM, Andrea Del Bene <an...@gmail.com>
wrote:

> Sorry...forgot to mention WICKET-6242 :-(
>
>
>
> On 13/09/2016 12:53, adelbene@apache.org wrote:
>
>> Repository: wicket
>> Updated Branches:
>>    refs/heads/WICKET-6242-authenticate-once 56f947ee5 -> bd365da40
>>
>>
>> Improved synchronization for signIn. Added missing header license.
>>
>> Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/bd365da4
>> Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/bd365da4
>> Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/bd365da4
>>
>> Branch: refs/heads/WICKET-6242-authenticate-once
>> Commit: bd365da409165093bbae52f51139419cc6e43ab3
>> Parents: 56f947e
>> Author: Andrea Del Bene <ad...@apache.org>
>> Authored: Tue Sep 13 12:37:59 2016 +0200
>> Committer: Andrea Del Bene <ad...@apache.org>
>> Committed: Tue Sep 13 12:37:59 2016 +0200
>>
>> ----------------------------------------------------------------------
>>   .../authentication/AuthenticatedWebSession.java     | 14 ++++----------
>>   .../authentication/AuthenticatedWebSessionTest.java | 16
>> ++++++++++++++++
>>   2 files changed, 20 insertions(+), 10 deletions(-)
>> ----------------------------------------------------------------------
>>
>>
>> http://git-wip-us.apache.org/repos/asf/wicket/blob/bd365da4/
>> wicket-auth-roles/src/main/java/org/apache/wicket/
>> authroles/authentication/AuthenticatedWebSession.java
>> ----------------------------------------------------------------------
>> diff --git a/wicket-auth-roles/src/main/java/org/apache/wicket/authrole
>> s/authentication/AuthenticatedWebSession.java
>> b/wicket-auth-roles/src/main/java/org/apache/wicket/authrole
>> s/authentication/AuthenticatedWebSession.java
>> index f0b450c..f11d718 100644
>> --- a/wicket-auth-roles/src/main/java/org/apache/wicket/authrole
>> s/authentication/AuthenticatedWebSession.java
>> +++ b/wicket-auth-roles/src/main/java/org/apache/wicket/authrole
>> s/authentication/AuthenticatedWebSession.java
>> @@ -63,17 +63,11 @@ public abstract class AuthenticatedWebSession extends
>> AbstractAuthenticatedWebSe
>>          */
>>         public final boolean signIn(final String username, final String
>> password)
>>         {
>> -               if (signedIn.compareAndSet(false, true))
>> +               boolean authenticated = authenticate(username, password);
>> +
>> +               if (authenticated && signedIn.compareAndSet(false, true))
>>                 {
>> -                       boolean authenticated = authenticate(username,
>> password);
>> -                       if (authenticated)
>> -                       {
>> -                               bind();
>> -                       }
>> -                       else
>> -                       {
>> -                               signedIn.set(false);
>> -                       }
>> +                       bind();
>>                 }
>>                 return signedIn.get();
>>         }
>>
>> http://git-wip-us.apache.org/repos/asf/wicket/blob/bd365da4/
>> wicket-auth-roles/src/test/java/org/apache/wicket/
>> authroles/authentication/AuthenticatedWebSessionTest.java
>> ----------------------------------------------------------------------
>> diff --git a/wicket-auth-roles/src/test/java/org/apache/wicket/authrole
>> s/authentication/AuthenticatedWebSessionTest.java
>> b/wicket-auth-roles/src/test/java/org/apache/wicket/authrole
>> s/authentication/AuthenticatedWebSessionTest.java
>> index c444d81..d91dd9d 100644
>> --- a/wicket-auth-roles/src/test/java/org/apache/wicket/authrole
>> s/authentication/AuthenticatedWebSessionTest.java
>> +++ b/wicket-auth-roles/src/test/java/org/apache/wicket/authrole
>> s/authentication/AuthenticatedWebSessionTest.java
>> @@ -1,3 +1,19 @@
>> +/*
>> + * 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.wicket.authroles.authentication;
>>     import static java.util.Locale.getDefault;
>>
>>
>

Re: wicket git commit: Improved synchronization for signIn. Added missing header license.

Posted by Andrea Del Bene <an...@gmail.com>.
Sorry...forgot to mention WICKET-6242 :-(


On 13/09/2016 12:53, adelbene@apache.org wrote:
> Repository: wicket
> Updated Branches:
>    refs/heads/WICKET-6242-authenticate-once 56f947ee5 -> bd365da40
>
>
> Improved synchronization for signIn. Added missing header license.
>
> Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
> Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/bd365da4
> Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/bd365da4
> Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/bd365da4
>
> Branch: refs/heads/WICKET-6242-authenticate-once
> Commit: bd365da409165093bbae52f51139419cc6e43ab3
> Parents: 56f947e
> Author: Andrea Del Bene <ad...@apache.org>
> Authored: Tue Sep 13 12:37:59 2016 +0200
> Committer: Andrea Del Bene <ad...@apache.org>
> Committed: Tue Sep 13 12:37:59 2016 +0200
>
> ----------------------------------------------------------------------
>   .../authentication/AuthenticatedWebSession.java     | 14 ++++----------
>   .../authentication/AuthenticatedWebSessionTest.java | 16 ++++++++++++++++
>   2 files changed, 20 insertions(+), 10 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/wicket/blob/bd365da4/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java
> ----------------------------------------------------------------------
> diff --git a/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java b/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java
> index f0b450c..f11d718 100644
> --- a/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java
> +++ b/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java
> @@ -63,17 +63,11 @@ public abstract class AuthenticatedWebSession extends AbstractAuthenticatedWebSe
>   	 */
>   	public final boolean signIn(final String username, final String password)
>   	{
> -		if (signedIn.compareAndSet(false, true))
> +		boolean authenticated = authenticate(username, password);
> +
> +		if (authenticated && signedIn.compareAndSet(false, true))
>   		{
> -			boolean authenticated = authenticate(username, password);
> -			if (authenticated)
> -			{
> -				bind();
> -			}
> -			else
> -			{
> -				signedIn.set(false);
> -			}
> +			bind();
>   		}
>   		return signedIn.get();
>   	}
>
> http://git-wip-us.apache.org/repos/asf/wicket/blob/bd365da4/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSessionTest.java
> ----------------------------------------------------------------------
> diff --git a/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSessionTest.java b/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSessionTest.java
> index c444d81..d91dd9d 100644
> --- a/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSessionTest.java
> +++ b/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSessionTest.java
> @@ -1,3 +1,19 @@
> +/*
> + * 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.wicket.authroles.authentication;
>   
>   import static java.util.Locale.getDefault;
>