Skip to content

Commit

Permalink
Initial implementation of External Identity Sources and Pipelines (CF…
Browse files Browse the repository at this point in the history
…M-32, CFM-33, etc)
  • Loading branch information
Benn Oshrin committed Oct 7, 2023
1 parent 74c452f commit 7803506
Show file tree
Hide file tree
Showing 87 changed files with 4,656 additions and 162 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,47 @@
msgid "controller.FileProvisioners"
msgstr "{0,plural,=1{File Provisioner} other{File Provisioners}}"

msgid "enumeration.FileSourceFormatEnum.C3"
msgstr "CSV v3"

msgid "error.filename.readable"
msgstr "The file \"{0}\" is not readable"

msgid "error.filename.writeable"
msgstr "The file \"{0}\" is not writable"

msgid "error.header"
msgstr "Did not find CSV file header"

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"
msgstr "Full path to file to write to, which must exist and be writeable"

msgid "field.FileSources.archivedir"
msgstr "Archive Directory"

msgid "field.FileSources.archivedir.desc"
msgstr "If specified, a limited number of prior copies of the source file will be stored here"

msgid "field.FileSources.filename"
msgstr "File Name"

msgid "field.FileSources.filename.desc"
msgstr "Full path to file to read from, which must exist and be readable"

msgid "field.FileSources.format"
msgstr "File Format"

msgid "field.FileSources.threshold_warn"
msgstr "Warning Threshold"

msgid "field.FileSources.threshold_warn.desc"
msgstr "If the number of changed records exceeds the specified percentage, a warning will be generated and processing will stop (requires Archive Directory)"

msgid "field.FileSources.threshold_override"
msgstr "Warning Threshold Override"

msgid "field.FileSources.threshold_override.desc"
msgstr "If set, the next Full sync will ignore the Warning Threshold"
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/**
* COmanage Registry File Sources 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 FileSourcesController extends StandardPluginController {
public $paginate = [
'order' => [
'FileSources.id' => 'asc'
]
];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* COmanage Registry File Source Format 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.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

declare(strict_types = 1);

namespace FileConnector\Lib\Enum;

use App\Lib\Enum\StandardEnum;

class FileSourceFormatEnum extends StandardEnum {
// We define v1 and v2 for legacy reasons, but we currently only support v3
// const CSV1 = 'C1';
// const CSV2 = 'C2';
const CSV3 = 'C3';
// JSON is not implemented (CO-2112)
// const JSON1 = 'J1';
}
49 changes: 49 additions & 0 deletions app/availableplugins/FileConnector/src/Model/Entity/FileSource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* COmanage Registry File Source 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 FileSource 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,
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function provision(

public function ruleIsFileWriteable($entity, array $options): string|bool {
if(!is_writable($entity->filename)) {
return __d('file_provisioner', 'error.filename.writeable', [$entity->filename]);
return __d('file_connector', 'error.filename.writeable', [$entity->filename]);
}

return true;
Expand Down
Loading

0 comments on commit 7803506

Please sign in to comment.