Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions app/availableplugins/UnixCluster/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# UnixCluster plugin for COmanage Registry

The Unix Cluster plugin manages Unix Accounts for People. Each instance represents
a single (logical) Unix Cluster, configured via a Cluster of type
`UnixCluster.UnixClusters`.

This is a non-core plugin. To enable it:

```
bin/cake plugin --action activate --plugin UnixCluster
```

## Usernames

Unix Cluster Account usernames are copied from the Person Identifier of the cluster's Username Type and may be at most 32 characters. The plugin does not restrict which characters a username contains, so formats such as `user@domain` can be used where the target systems support them. For portable usernames, generate the Username Identifier with an Identifier Assignment whose Permitted Characters setting is *AlphaNumeric Only*. Characters such as `:`, `/`, `\`, whitespace, control characters or a leading `-` can break `/etc/passwd`, home directory paths, terminals and scripts on many systems.

See the [Unix Cluster Plugin documentation](https://spaces.at.internet2.edu/display/COmanage/Unix+Cluster+Plugin)
for more information.
24 changes: 24 additions & 0 deletions app/availableplugins/UnixCluster/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "comanage-registry/unix-cluster",
"description": "UnixCluster 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": {
"UnixCluster\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"UnixCluster\\Test\\": "tests/",
"Cake\\Test\\": "vendor/cakephp/cakephp/tests/"
}
}
}
76 changes: 76 additions & 0 deletions app/availableplugins/UnixCluster/config/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"types": {
"cluster": [
"UnixClusters"
]
},
"schema": {
"tables": {
"unix_clusters": {
"columns": {
"id": {},
"cluster_id": {},
"sync_mode": { "type": "enum" },
"username_type_id": { "type": "integer", "foreignkey": { "table": "types", "column": "id" } },
"uid_type_id": { "type": "integer", "foreignkey": { "table": "types", "column": "id" } },
"default_shell": { "type": "string", "size": 64 },
"homedir_prefix": { "type": "string", "size": 64 },
"homedir_subdivisions": { "type": "integer" },
"groupname_type_id": { "type": "integer", "foreignkey": { "table": "types", "column": "id" } },
"gid_type_id": { "type": "integer", "foreignkey": { "table": "types", "column": "id" } },
"default_group_mode": {
"type": "enum",
"comment": "Explicit Existing/Personal mode, so that an empty default_group_id never implicitly means create a personal group per account"
},
"default_group_id": { "type": "integer", "foreignkey": { "table": "groups", "column": "id" }, "notnull": false }
},
"indexes": {
"unix_clusters_i1": { "columns": [ "cluster_id" ]},
"unix_clusters_i2": { "needed": false, "columns": [ "username_type_id" ]},
"unix_clusters_i3": { "needed": false, "columns": [ "uid_type_id" ]},
"unix_clusters_i4": { "needed": false, "columns": [ "groupname_type_id" ]},
"unix_clusters_i5": { "needed": false, "columns": [ "gid_type_id" ]},
"unix_clusters_i6": { "needed": false, "columns": [ "default_group_id" ]}
}
},
"unix_cluster_groups": {
"columns": {
"id": {},
"unix_cluster_id": { "type": "integer", "foreignkey": { "table": "unix_clusters", "column": "id" }, "notnull": true },
"group_id": { "notnull": true },
"origin": { "type": "enum" },
"person_id": { "notnull": false }
},
"indexes": {
"unix_cluster_groups_i1": { "columns": [ "unix_cluster_id" ]},
"unix_cluster_groups_i2": { "columns": [ "group_id" ]},
"unix_cluster_groups_i3": { "columns": [ "person_id" ]}
}
},
"unix_cluster_accounts": {
"columns": {
"id": {},
"unix_cluster_id": { "type": "integer", "foreignkey": { "table": "unix_clusters", "column": "id" }, "notnull": true },
"person_id": { "notnull": true },
"sync_mode": { "type": "enum" },
"status": {},
"username": { "size": 32 },
"uid": { "type": "integer" },
"gecos": { "type": "string", "size": 80 },
"login_shell": { "type": "string", "size": 64 },
"home_directory": { "type": "path" },
"primary_group_id": { "type": "integer", "foreignkey": { "table": "groups", "column": "id" } },
"valid_from": {},
"valid_through": {}
},
"indexes": {
"unix_cluster_accounts_i1": { "columns": [ "unix_cluster_id" ]},
"unix_cluster_accounts_i2": { "columns": [ "person_id" ]},
"unix_cluster_accounts_i3": { "columns": [ "unix_cluster_id", "username" ]},
"unix_cluster_accounts_i4": { "columns": [ "unix_cluster_id", "uid" ]},
"unix_cluster_accounts_i5": { "columns": [ "primary_group_id" ]}
}
}
}
}
}
30 changes: 30 additions & 0 deletions app/availableplugins/UnixCluster/phpunit.xml.dist
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="UnixCluster">
<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>
Loading