-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial com_saml SAML IdP component (MVP)
- Loading branch information
Showing
14 changed files
with
633 additions
and
0 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,18 @@ | ||
<?php | ||
/** | ||
* @package hubzero-cms | ||
* @copyright Copyright (c) 2005-2024 The Regents of the University of California. | ||
* @license http://opensource.org/licenses/MIT MIT | ||
*/ | ||
|
||
namespace Components\Saml\Admin\Controllers; | ||
|
||
use Hubzero\Component\AdminController; | ||
|
||
class SAML extends AdminController | ||
{ | ||
public function displayTask() | ||
{ | ||
$this->view->setLayout('saml')->display(); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
core/components/com_saml/admin/language/en-GB/en-GB.com_saml.ini
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,9 @@ | ||
; @package hubzero-cms | ||
; @copyright Copyright (c) 2005-2024 The Regents of the University of California. | ||
; @license http://opensource.org/licenses/MIT MIT | ||
|
||
; Note : All ini files need to be saved as UTF-8 - No BOM | ||
|
||
COM_SAML="SAML" | ||
COM_CONFIG_IDP_FIELDSET_LABEL="Identity Provider" | ||
COM_CONFIG_SP_FIELDSET_LABEL="Service Provider" |
8 changes: 8 additions & 0 deletions
8
core/components/com_saml/admin/language/en-GB/en-GB.com_saml.sys.ini
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,8 @@ | ||
; @package hubzero-cms | ||
; @copyright Copyright (c) 2005-2024 The Regents of the University of California. | ||
; @license http://opensource.org/licenses/MIT MIT | ||
|
||
; Note : All ini files need to be saved as UTF-8 - No BOM | ||
|
||
COM_SAML="SAML" | ||
|
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,28 @@ | ||
<?php | ||
/** | ||
* @package hubzero-cms | ||
* @copyright Copyright (c) 2005-2024 The Regents of the University of California. | ||
* @license http://opensource.org/licenses/MIT MIT | ||
*/ | ||
|
||
namespace Components\Saml\Admin; | ||
|
||
if (!\User::authorise('core.manage', 'com_saml')) | ||
{ | ||
return \App::abort(404, \Lang::txt('JERROR_ALERTNOAUTHOR')); | ||
} | ||
|
||
$controllerName = \Request::getCmd('controller', 'saml'); | ||
|
||
if (!file_exists(__DIR__ . DS . 'controllers' . DS . $controllerName . '.php')) | ||
{ | ||
$controllerName = 'saml'; | ||
} | ||
|
||
require_once __DIR__ . DS . 'controllers' . DS . $controllerName . '.php'; | ||
|
||
$controllerName = __NAMESPACE__ . '\\Controllers\\' . ucfirst(strtolower($controllerName)); | ||
|
||
$controller = new $controllerName(); | ||
|
||
$controller->execute(); |
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,23 @@ | ||
<?php | ||
/** | ||
* @package hubzero-cms | ||
* @copyright Copyright (c) 2005-2024 The Regents of the University of California. | ||
* @license http://opensource.org/licenses/MIT MIT | ||
*/ | ||
|
||
// No direct access | ||
defined('_HZEXEC_') or die(); | ||
|
||
Toolbar::title(Lang::txt('COM_SAML_TITLE'), 'SAML'); | ||
|
||
if (User::authorise('core.admin', $this->option)) | ||
{ | ||
Toolbar::preferences($this->option, '550'); | ||
} | ||
?> | ||
|
||
<section> | ||
<div> | ||
<p>There are no administrative functions for this component yet.</p> | ||
</div> | ||
</section> |
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,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<!-- | ||
@package hubzero-cms | ||
@copyright Copyright (c) 2005-2024 The Regents of the University of California. | ||
@license http://opensource.org/licenses/MIT MIT | ||
--> | ||
|
||
<access component="com_saml"> | ||
<section name="component"> | ||
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" /> | ||
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" /> | ||
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" /> | ||
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" /> | ||
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" /> | ||
</section> | ||
</access> |
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,107 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<!-- | ||
@package hubzero-cms | ||
@copyright Copyright (c) 2005-2024 The Regents of the University of California. | ||
@license http://opensource.org/licenses/MIT MIT | ||
--> | ||
|
||
<config> | ||
<fieldset name="IdP"> | ||
<field | ||
name="IdP_enable" | ||
type="radio" | ||
default="1" | ||
label="COM_SAML_CONFIG_FIELD_IDPENABLE_LABEL" | ||
description="COM_SAML_CONFIG_FIELD_IDPENABLE_DESC"> | ||
<option | ||
value="0">JNO</option> | ||
<option | ||
value="1">JYES</option> | ||
</field> | ||
<field | ||
name="IdP_entityID" | ||
type="text" | ||
menu="hide" | ||
default="" | ||
label="COM_SAML_CONFIG_FIELD_IDPENTITYID_LABEL" | ||
description="COM_SAML_CONFIG_FIELD_IDPENTITYID_DESC"> | ||
</field> | ||
<field | ||
name="enableIdPMetadataEndpoint" | ||
type="radio" | ||
default="1" | ||
label="COM_SAML_CONFIG_FIELD_ENABLEIDPMETADATAENDPOINT_LABEL" | ||
description="COM_SAML_CONFIG_FIELD_ENABLEIDPMETADATAENDPOINT_DESC"> | ||
<option | ||
value="0">JNO</option> | ||
<option | ||
value="1">JYES</option> | ||
</field> | ||
<field | ||
name="IdPCertificateFile" | ||
type="text" | ||
menu="hide" | ||
default="" | ||
label="COM_SAML_CONFIG_FIELD_IDPCERTIFICATEFILE_LABEL" | ||
description="COM_SAML_CONFIG_FIELD_IDPCERTIFICATEFILE_DESC"> | ||
</field> | ||
<field | ||
name="IdPKeyFile" | ||
type="text" | ||
menu="hide" | ||
default="" | ||
label="COM_SAML_CONFIG_FIELD_IDPKEYFILE_LABEL" | ||
description="COM_SAML_CONFIG_FIELD_IDPKEYFILE_DESC"> | ||
</field> | ||
|
||
</fieldset> | ||
<fieldset name="SP"> | ||
<field | ||
name="SP_enable" | ||
type="radio" | ||
default="1" | ||
label="COM_SAML_CONFIG_FIELD_SPENABLE_LABEL" | ||
description="COM_SAML_CONFIG_FIELD_SPENABLE_DESC"> | ||
<option | ||
value="0">JNO</option> | ||
<option | ||
value="1">JYES</option> | ||
</field> | ||
<field | ||
name="SP_entityID" | ||
type="text" | ||
menu="hide" | ||
default="" | ||
label="COM_SAML_CONFIG_FIELD_SPENTITYID_LABEL" | ||
description="COM_SAML_CONFIG_FIELD_SPENTITYID_DESC"> | ||
</field> | ||
<field | ||
name="enableSPMetadataEndpoint" | ||
type="radio" | ||
default="1" | ||
label="COM_SAML_CONFIG_FIELD_ENABLESPMETADATAENDPOINT_LABEL" | ||
description="COM_SAML_CONFIG_FIELD_ENABLESPMETADATAENDPOINT_DESC"> | ||
<option | ||
value="0">JNO</option> | ||
<option | ||
value="1">JYES</option> | ||
</field> | ||
<field | ||
name="SPCertificateFile" | ||
type="text" | ||
menu="hide" | ||
default="" | ||
label="COM_SAML_CONFIG_FIELD_SPCERTIFICATEFILE_LABEL" | ||
description="COM_SAML_CONFIG_FIELD_SPCERTIFICATEFILE_DESC"> | ||
</field> | ||
<field | ||
name="SPKeyFile" | ||
type="text" | ||
menu="hide" | ||
default="" | ||
label="COM_SAML_CONFIG_FIELD_SPKEYFILE_LABEL" | ||
description="COM_SAML_CONFIG_FIELD_SPKEYFILE_DESC"> | ||
</field> | ||
</fieldset> | ||
</config> |
33 changes: 33 additions & 0 deletions
33
core/components/com_saml/migrations/Migration20240820152900ComSaml.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,33 @@ | ||
<?php | ||
/** | ||
* @package hubzero-cms | ||
* @copyright Copyright (c) 2005-2024 The Regents of the University of California. | ||
* @license http://opensource.org/licenses/MIT MIT | ||
*/ | ||
|
||
use Hubzero\Content\Migration\Base; | ||
|
||
// No direct access | ||
defined('_HZEXEC_') or die(); | ||
|
||
/** | ||
* Migration script for adding component entry for com_saml | ||
**/ | ||
class Migration20240820152900ComSaml extends Base | ||
{ | ||
/** | ||
* Up | ||
**/ | ||
public function up() | ||
{ | ||
$this->addComponentEntry('saml'); | ||
} | ||
|
||
/** | ||
* Down | ||
**/ | ||
public function down() | ||
{ | ||
$this->deleteComponentEntry('saml'); | ||
} | ||
} |
Oops, something went wrong.