Skip to content

Commit

Permalink
Initial commit of HttpServer (CFM-101) and MatchServer (CFM-104)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Apr 12, 2025
1 parent 1310e37 commit 79e662d
Show file tree
Hide file tree
Showing 15 changed files with 705 additions and 35 deletions.
3 changes: 3 additions & 0 deletions app/config/schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,21 @@
"message_template_id": { "type": "integer", "foreignkey": { "table": "message_templates", "column": "id" } },
"name": { "type": "string", "size": 128, "notnull": true },
"ordr": { "type": "integer" },
"password": { "type": "string", "size": 400 },
"person_id": { "type": "integer", "foreignkey": { "table": "people", "column": "id" } },
"person_role_id": { "type": "integer", "foreignkey": { "table": "person_roles", "column": "id" } },
"petition_id": { "type": "integer", "foreignkey": { "table": "petitions", "column": "id" } },
"plugin": { "type": "string", "size": 80 },
"provisioning_target_id": { "type": "integer", "foreignkey": { "table": "provisioning_targets", "column": "id" }, "notnull": true },
"reference_identifier": { "type": "string", "size": 40 },
"report_id": { "type": "integer", "foreignkey": { "table": "reports", "column": "id" }, "notnull": true },
"required": { "type": "string", "size": 2 },
"server_id": { "type": "integer", "foreignkey": { "table": "servers", "column": "id" }, "notnull": true },
"sor_label": { "type": "string", "size": 40 },
"status": { "type": "string", "size": 2 },
"traffic_detour_id": { "type": "integer", "foreignkey": { "table": "traffic_detours", "column": "id" }, "notnull": true },
"type_id": { "type": "integer", "foreignkey": { "table": "types", "column": "id" }, "notnull": true },
"username": { "type": "string", "size": 128 },
"valid_from": { "type": "datetime" },
"valid_through": { "type": "datetime" }
}
Expand Down
44 changes: 24 additions & 20 deletions app/plugins/CoreServer/resources/locales/en_US/core_server.po
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,27 @@
# @since COmanage Registry v5.0.0
# @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)

msgid "controller.HttpServers"
msgstr "{0,plural,=1{HTTP Server} other{HTTP Servers}}"

msgid "controller.MatchServers"
msgstr "{0,plural,=1{Match Server} other{Match Servers}}"

msgid "controller.SmtpServers"
msgstr "{0,plural,=1{SMTP Server} other{SMTP Servers}}"

msgid "controller.SqlServers"
msgstr "{0,plural,=1{SQL Server} other{SQL Servers}}"

msgid "enumeration.HttpAuthTypeEnum.BA"
msgstr "Basic"

msgid "enumeration.HttpAuthTypeEnum.BE"
msgstr "Bearer"

msgid "enumeration.HttpAuthTypeEnum.X"
msgstr "None"

msgid "enumeration.RdbmsTypeEnum.LT"
msgstr "SQLite"

Expand All @@ -46,28 +61,27 @@ msgstr "Oracle"
msgid "enumeration.RdbmsTypeEnum.PG"
msgstr "Postgres"

msgid "field.auth_type"
msgstr "Authentication Type"

msgid "field.skip_ssl_verification"
msgstr "Skip SSL Verification"

msgid "field.MatchServers.api_endpoint"
msgstr "API Endpoint"

msgid "field.SmtpServers.default_from"
msgstr "Default From Address"

msgid "field.SmtpServers.default_reply_to"
msgstr "Default Reply-To Address"

msgid "field.SmtpServers.hostname"
msgstr "Hostname"

msgid "field.SmtpServers.override_to"
msgstr "Delivery Override"

msgid "field.SmtpServers.override_to.desc"
msgstr "If set, all outgoing email will only be sent to this address"

# XXX Temporary?
msgid "field.SmtpServers.password"
msgstr "Password"

msgid "field.SmtpServers.port"
msgstr "Port"

msgid "field.SmtpServers.use_tls"
msgstr "Use TLS"

Expand All @@ -80,16 +94,6 @@ msgstr "OracleClient plugin is not loaded"
msgid "field.SqlServers.databas"
msgstr "Database Name"

msgid "field.SqlServers.hostname"
msgstr "Hostname"

# XXX Temporary?
msgid "field.SqlServers.password"
msgstr "Password"

msgid "field.SqlServers.port"
msgstr "Port"

msgid "field.SqlServers.port.desc"
msgstr "Specify the port only if a non-standard port number is in use"

Expand Down
40 changes: 40 additions & 0 deletions app/plugins/CoreServer/src/Controller/HttpServersController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/**
* COmanage Registry HTTP Servers Controller
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID 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.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry-plugins
* @since COmanage Registry v5.2.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

declare(strict_types=1);

namespace CoreServer\Controller;

use App\Controller\StandardPluginController;

class HttpServersController extends StandardPluginController {
public $paginate = [
'order' => [
'HttpServers.url' => 'asc'
]
];
}
59 changes: 59 additions & 0 deletions app/plugins/CoreServer/src/Controller/MatchServersController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php
/**
* COmanage Registry Match Servers Controller
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID 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.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry-plugins
* @since COmanage Registry v5.2.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

declare(strict_types=1);

namespace CoreServer\Controller;

use App\Controller\StandardPluginController;
use Cake\Event\EventInterface;

class MatchServersController extends StandardPluginController {
public $paginate = [
'order' => [
'MatchServers.url' => 'asc'
]
];

/**
* Callback run prior to the request render.
*
* @param EventInterface $event Cake Event
*
* @return Response|void
* @since COmanage Registry v5.2.0
*/

public function beforeRender(EventInterface $event) {
// Generate the callback URL

// XXX this needs to be updated for whereever the new API lands
$this->set('vv_api_endpoint', \Cake\Routing\Router::url('/', true) . 'api/co/' . $this->getCOID() . '/core/v1/resolution');

return parent::beforeRender($event);
}
}
38 changes: 38 additions & 0 deletions app/plugins/CoreServer/src/Lib/Enum/HttpAuthTypeEnum.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* COmanage Registry HTTP Auth Type Enum
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID 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.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry-plugins
* @since COmanage Registry v5.2.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

declare(strict_types = 1);

namespace CoreServer\Lib\Enum;

use App\Lib\Enum\StandardEnum;

class HttpAuthTypeEnum extends StandardEnum {
const Basic = "BA";
const Bearer = "BE";
const None = "X";
}
49 changes: 49 additions & 0 deletions app/plugins/CoreServer/src/Model/Entity/HttpServer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* COmanage Registry HTTP Server Entity
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID 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.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry-plugins
* @since COmanage Registry v5.2.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

declare(strict_types=1);

namespace CoreServer\Model\Entity;

use Cake\ORM\Entity;

class HttpServer extends Entity {
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array<string, bool>
*/
protected $_accessible = [
'*' => true,
'id' => false,
'slug' => false,
];
}
49 changes: 49 additions & 0 deletions app/plugins/CoreServer/src/Model/Entity/MatchServer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* COmanage Registry Match Server Entity
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID 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.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry-plugins
* @since COmanage Registry v5.2.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

declare(strict_types=1);

namespace CoreServer\Model\Entity;

use Cake\ORM\Entity;

class MatchServer extends Entity {
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array<string, bool>
*/
protected $_accessible = [
'*' => true,
'id' => false,
'slug' => false,
];
}
Loading

0 comments on commit 79e662d

Please sign in to comment.