You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by mike-jumper <gi...@git.apache.org> on 2016/07/29 02:55:56 UTC

[GitHub] incubator-guacamole-client pull request #39: GUACAMOLE-5: Separate sharing s...

GitHub user mike-jumper opened a pull request:

    https://github.com/apache/incubator-guacamole-client/pull/39

    GUACAMOLE-5: Separate sharing semantics from database-backed AuthenticationProvider

    The database authentication backend currently implements support for unique "share keys", which can be used as an alternative and temporary method of authentication for accessing shared connections. Prior to this change, it was the duty of the `AuthenticationProvider` to handle both username/password authentication *and* share key authentication.
    
    This change splits the PostgreSQL/MySQL `AuthenticationProvider` implementations into two: one which is specific to username/password auth against the database, and the other which is specific to share key authentication against in-memory shared connections. Both share a common Guice `Injector` and, thus, a common set of core services. Collaborative management of shared connections between the two is achieved through a common service which handles registration and retrieval of shared connections and their corresponding keys.
    
    This change is architectural, as it is a necessary step to cleanly implement support for use of multiple share keys within the same session, even if that session was due to a username/password login. The existing functionality is unaffected.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mike-jumper/incubator-guacamole-client separate-auth-providers

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-guacamole-client/pull/39.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #39
    
----
commit a59b0124b959398d9006539b447eca950510ddeb
Author: Michael Jumper <mj...@apache.org>
Date:   2016-07-28T18:20:19Z

    GUACAMOLE-5: Use singleton Guice Injector via common base class.

commit 2f5f31b7f46773085d7c5e82c00b38df9dfabda9
Author: Michael Jumper <mj...@apache.org>
Date:   2016-07-29T00:16:03Z

    GUACAMOLE-5: Use AuthenticationProviderService as the means of defining AuthenticationProvider behavior.

commit 591ad4ac83ad079d395faa831bcd84ef1df0e901
Author: Michael Jumper <mj...@apache.org>
Date:   2016-07-29T02:45:43Z

    GUACAMOLE-5: Handle shared connections via dedicated AuthenticationProvider.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-guacamole-client pull request #39: GUACAMOLE-5: Separate sharing s...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-guacamole-client/pull/39


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-guacamole-client pull request #39: GUACAMOLE-5: Separate sharing s...

Posted by mike-jumper <gi...@git.apache.org>.
Github user mike-jumper closed the pull request at:

    https://github.com/apache/incubator-guacamole-client/pull/39


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-guacamole-client pull request #39: GUACAMOLE-5: Separate sharing s...

Posted by mike-jumper <gi...@git.apache.org>.
Github user mike-jumper commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-client/pull/39#discussion_r72879907
  
    --- Diff: extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/java/org/apache/guacamole/auth/postgresql/PostgreSQLInjectorProvider.java ---
    @@ -0,0 +1,51 @@
    +/*
    + * 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.guacamole.auth.postgresql;
    +
    +import com.google.inject.Guice;
    +import com.google.inject.Injector;
    +import org.apache.guacamole.GuacamoleException;
    +import org.apache.guacamole.auth.jdbc.JDBCAuthenticationProviderModule;
    +import org.apache.guacamole.auth.jdbc.JDBCInjectorProvider;
    +
    +/**
    + * JDBCInjectorProvider implementation which configures Guice injections for
    + * connecting to a PostgreSQL database based on PostgreSQL-specific options
    + * provided via guacamole.properties.
    + *
    + * @author Michael Jumper
    + */
    +public class PostgreSQLInjectorProvider extends JDBCInjectorProvider {
    +
    +    @Override
    +    protected Injector create() throws GuacamoleException {
    +
    +        // Get local environment
    +        PostgreSQLEnvironment environment = new PostgreSQLEnvironment();
    +
    +        // Set up Guice injector.
    --- End diff --
    
    No problem. I'll rebase such that it never happened.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-guacamole-client pull request #39: GUACAMOLE-5: Separate sharing s...

Posted by mike-jumper <gi...@git.apache.org>.
GitHub user mike-jumper reopened a pull request:

    https://github.com/apache/incubator-guacamole-client/pull/39

    GUACAMOLE-5: Separate sharing semantics from database-backed AuthenticationProvider

    The database authentication backend currently implements support for unique "share keys", which can be used as an alternative and temporary method of authentication for accessing shared connections. Prior to this change, it was the duty of the `AuthenticationProvider` to handle both username/password authentication *and* share key authentication.
    
    This change splits the PostgreSQL/MySQL `AuthenticationProvider` implementations into two: one which is specific to username/password auth against the database, and the other which is specific to share key authentication against in-memory shared connections. Both share a common Guice `Injector` and, thus, a common set of core services. Collaborative management of shared connections between the two is achieved through a common service which handles registration and retrieval of shared connections and their corresponding keys.
    
    This change is architectural, as it is a necessary step to cleanly implement support for use of multiple share keys within the same session, even if that session was due to a username/password login. The existing functionality is unaffected.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mike-jumper/incubator-guacamole-client separate-auth-providers

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-guacamole-client/pull/39.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #39
    
----
commit a59b0124b959398d9006539b447eca950510ddeb
Author: Michael Jumper <mj...@apache.org>
Date:   2016-07-28T18:20:19Z

    GUACAMOLE-5: Use singleton Guice Injector via common base class.

commit 2f5f31b7f46773085d7c5e82c00b38df9dfabda9
Author: Michael Jumper <mj...@apache.org>
Date:   2016-07-29T00:16:03Z

    GUACAMOLE-5: Use AuthenticationProviderService as the means of defining AuthenticationProvider behavior.

commit 591ad4ac83ad079d395faa831bcd84ef1df0e901
Author: Michael Jumper <mj...@apache.org>
Date:   2016-07-29T02:45:43Z

    GUACAMOLE-5: Handle shared connections via dedicated AuthenticationProvider.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-guacamole-client pull request #39: GUACAMOLE-5: Separate sharing s...

Posted by jmuehlner <gi...@git.apache.org>.
Github user jmuehlner commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-client/pull/39#discussion_r72879376
  
    --- Diff: extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/java/org/apache/guacamole/auth/postgresql/PostgreSQLInjectorProvider.java ---
    @@ -0,0 +1,51 @@
    +/*
    + * 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.guacamole.auth.postgresql;
    +
    +import com.google.inject.Guice;
    +import com.google.inject.Injector;
    +import org.apache.guacamole.GuacamoleException;
    +import org.apache.guacamole.auth.jdbc.JDBCAuthenticationProviderModule;
    +import org.apache.guacamole.auth.jdbc.JDBCInjectorProvider;
    +
    +/**
    + * JDBCInjectorProvider implementation which configures Guice injections for
    + * connecting to a PostgreSQL database based on PostgreSQL-specific options
    + * provided via guacamole.properties.
    + *
    + * @author Michael Jumper
    + */
    +public class PostgreSQLInjectorProvider extends JDBCInjectorProvider {
    +
    +    @Override
    +    protected Injector create() throws GuacamoleException {
    +
    +        // Get local environment
    +        PostgreSQLEnvironment environment = new PostgreSQLEnvironment();
    +
    +        // Set up Guice injector.
    --- End diff --
    
    In another of my Minor Comment Quibbles\u2122, I'll point out that this is a strange place for a period in a comment.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---