-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit for Provisioning (CFM-254), Servers (CFM-100), Sql Pro…
…visioner (CFM-74), etc
- Loading branch information
Benn Oshrin
committed
Jun 7, 2023
1 parent
b8f3f87
commit 1dcd3e1
Showing
137 changed files
with
6,405 additions
and
497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# FileProvisioner plugin for CakePHP | ||
|
||
## Installation | ||
|
||
You can install this plugin into your CakePHP application using [composer](https://getcomposer.org). | ||
|
||
The recommended way to install composer packages is: | ||
|
||
``` | ||
composer require your-name-here/file-provisioner | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "comanage-registry/file-provisioner", | ||
"description": "FileConnector plugin for COmanage Registry", | ||
"type": "cakephp-plugin", | ||
"license": "MIT", | ||
"require": { | ||
"php": ">=7.2", | ||
"cakephp/cakephp": "4.4.*" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^8.5 || ^9.3" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"FileConnector\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"FileConnector\\Test\\": "tests/", | ||
"Cake\\Test\\": "vendor/cakephp/cakephp/tests/" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit | ||
colors="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
bootstrap="tests/bootstrap.php" | ||
> | ||
<php> | ||
<ini name="memory_limit" value="-1"/> | ||
<ini name="apc.enable_cli" value="1"/> | ||
</php> | ||
|
||
<!-- Add any additional test suites you want to run here --> | ||
<testsuites> | ||
<testsuite name="FileProvisioner"> | ||
<directory>tests/TestCase/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<!-- Setup fixture extension --> | ||
<extensions> | ||
<extension class="Cake\TestSuite\Fixture\PHPUnitExtension" /> | ||
</extensions> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">src/</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
35 changes: 35 additions & 0 deletions
35
app/availableplugins/FileConnector/resources/locales/en_US/file_connector.po
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# COmanage Registry Localizations (file_provisioner domain) | ||
# | ||
# 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 | ||
# @since COmanage Registry v5.0.0 | ||
# @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
|
||
msgid "controller.FileProvisioners" | ||
msgstr "{0,plural,=1{File Provisioner} other{File Provisioners}}" | ||
|
||
msgid "error.filename.writeable" | ||
msgstr "The file \"{0}\" is not writable" | ||
|
||
msgid "field.FileProvisioners.filename" | ||
msgstr "File Name" | ||
|
||
msgid "field.FileProvisioners.filename.desc" | ||
msgstr "Full path to file to write to, which must exist and be writeable" |
10 changes: 10 additions & 0 deletions
10
app/availableplugins/FileConnector/src/Controller/AppController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace FileProvisioner\Controller; | ||
|
||
use App\Controller\AppController as BaseController; | ||
|
||
class AppController extends BaseController | ||
{ | ||
} |
40 changes: 40 additions & 0 deletions
40
app/availableplugins/FileConnector/src/Controller/FileProvisionersController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
/** | ||
* COmanage Registry File Provisioners 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.0.0 | ||
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace FileConnector\Controller; | ||
|
||
use App\Controller\StandardPluginController; | ||
|
||
class FileProvisionersController extends StandardPluginController { | ||
public $paginate = [ | ||
'order' => [ | ||
'FileProvisioners.id' => 'asc' | ||
] | ||
]; | ||
} |
93 changes: 93 additions & 0 deletions
93
app/availableplugins/FileConnector/src/FileConnectorPlugin.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace FileConnector; | ||
|
||
use Cake\Console\CommandCollection; | ||
use Cake\Core\BasePlugin; | ||
use Cake\Core\ContainerInterface; | ||
use Cake\Core\PluginApplicationInterface; | ||
use Cake\Http\MiddlewareQueue; | ||
use Cake\Routing\RouteBuilder; | ||
|
||
/** | ||
* Plugin for FileConnector | ||
*/ | ||
class FileConnectorPlugin extends BasePlugin | ||
{ | ||
/** | ||
* Load all the plugin configuration and bootstrap logic. | ||
* | ||
* The host application is provided as an argument. This allows you to load | ||
* additional plugin dependencies, or attach events. | ||
* | ||
* @param \Cake\Core\PluginApplicationInterface $app The host application | ||
* @return void | ||
*/ | ||
public function bootstrap(PluginApplicationInterface $app): void | ||
{ | ||
} | ||
|
||
/** | ||
* Add routes for the plugin. | ||
* | ||
* If your plugin has many routes and you would like to isolate them into a separate file, | ||
* you can create `$plugin/config/routes.php` and delete this method. | ||
* | ||
* @param \Cake\Routing\RouteBuilder $routes The route builder to update. | ||
* @return void | ||
*/ | ||
public function routes(RouteBuilder $routes): void | ||
{ | ||
$routes->plugin( | ||
'FileConnector', | ||
['path' => '/file-connector'], | ||
function (RouteBuilder $builder) { | ||
// Add custom routes here | ||
|
||
$builder->fallbacks(); | ||
} | ||
); | ||
parent::routes($routes); | ||
} | ||
|
||
/** | ||
* Add middleware for the plugin. | ||
* | ||
* @param \Cake\Http\MiddlewareQueue $middlewareQueue The middleware queue to update. | ||
* @return \Cake\Http\MiddlewareQueue | ||
*/ | ||
public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue | ||
{ | ||
// Add your middlewares here | ||
|
||
return $middlewareQueue; | ||
} | ||
|
||
/** | ||
* Add commands for the plugin. | ||
* | ||
* @param \Cake\Console\CommandCollection $commands The command collection to update. | ||
* @return \Cake\Console\CommandCollection | ||
*/ | ||
public function console(CommandCollection $commands): CommandCollection | ||
{ | ||
// Add your commands here | ||
|
||
$commands = parent::console($commands); | ||
|
||
return $commands; | ||
} | ||
|
||
/** | ||
* Register application container services. | ||
* | ||
* @param \Cake\Core\ContainerInterface $container The Container to update. | ||
* @return void | ||
* @link https://book.cakephp.org/4/en/development/dependency-injection.html#dependency-injection | ||
*/ | ||
public function services(ContainerInterface $container): void | ||
{ | ||
// Add your services here | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
app/availableplugins/FileConnector/src/Model/Entity/FileProvisioner.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/** | ||
* COmanage Registry File Provisioner Table | ||
* | ||
* 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.0.0 | ||
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace FileConnector\Model\Entity; | ||
|
||
use Cake\ORM\Entity; | ||
|
||
class FileProvisioner 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, | ||
]; | ||
} |
Oops, something went wrong.