~fkooman/vpn-user-portal

6b1e1d999adc8d4b0b51068cce87d4b8dbc8da97 — Fran├žois Kooman 4 months ago 5f5d9a8
add govVPN OAuth client registrations (disabled by default)
3 files changed, 66 insertions(+), 0 deletions(-)

M src/OAuth/VpnClientDb.php
M web/css/screen.css
A web/img/icon-govVPN.png
M src/OAuth/VpnClientDb.php => src/OAuth/VpnClientDb.php +62 -0
@@ 30,6 30,9 @@ class VpnClientDb extends SimpleClientDb
        if (in_array('LC', $appSets, true)) {
            $this->LC();
        }
        if (in_array('govVPN', $appSets, true)) {
            $this->govVPN();
        }
        $this->fromJsonFile($jsonClientDbFile);
    }



@@ 161,4 164,63 @@ class VpnClientDb extends SimpleClientDb
            )
        );
    }

    private function govVPN(): void
    {
        $this->add(
            new ClientInfo(
                'org.govvpn.app.windows',
                ['http://127.0.0.1:{PORT}/callback', 'http://[::1]:{PORT}/callback'],
                null,
                'govVPN for Windows',
                true,
                new Scope('config')
            )
        );
        $this->add(
            new ClientInfo(
                'org.govvpn.app.android',
                [
                    // we want the scheme of the redirect_uri to match the
                    // client_id, initially we made a mistake on Android...
                    'org.govvpn.app:/api/callback',
                    'org.govvpn.app.android:/api/callback',
                ],
                null,
                'govVPN for Android',
                true,
                new Scope('config')
            )
        );
        $this->add(
            new ClientInfo(
                'org.govvpn.app.ios',
                ['org.govvpn.app.ios:/api/callback'],
                null,
                'govVPN for iOS',
                true,
                new Scope('config')
            )
        );
        $this->add(
            new ClientInfo(
                'org.govvpn.app.macos',
                ['http://127.0.0.1:{PORT}/callback', 'http://[::1]:{PORT}/callback'],
                null,
                'govVPN for macOS',
                true,
                new Scope('config')
            )
        );
        $this->add(
            new ClientInfo(
                'org.govvpn.app.linux',
                ['http://127.0.0.1:{PORT}/callback', 'http://[::1]:{PORT}/callback'],
                null,
                'govVPN for Linux',
                true,
                new Scope('config')
            )
        );
    }
}

M web/css/screen.css => web/css/screen.css +4 -0
@@ 541,6 541,10 @@ div.appApproval span[class^="org.eduvpn.app"] {
  background-image: url("../img/icon-eduVPN.png");
}

div.appApproval span[class^="org.govvpn.app"] {
  background-image: url("../img/icon-govVPN.png");
}

div.appApproval form.frm {
  display: inline-block;
  width: initial;

A web/img/icon-govVPN.png => web/img/icon-govVPN.png +0 -0