Skip to content

Commit

Permalink
fix(jans-casa): jans-casa installation issues (#6198)
Browse files Browse the repository at this point in the history
* fix(jans-casa): url prefix in Casa.py

* fix(jans-linux-setup): missing slash in jans-casa_web_resources.xml

* fix(jans-linux-setup): don't copy Casa.py to webapps directory

* fix(casa): remove original casa_web_resources.xml

* fix(jans-linux-setup): extract casa files from jans.zip

* fix(casa): revert login.xhtml path
  • Loading branch information
devrimyatar authored Oct 7, 2023
1 parent e8943d7 commit 2775d6f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 30 deletions.
2 changes: 1 addition & 1 deletion jans-casa/extras/Casa.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def prepareUIParams(self, identity):
prefix = custPrefix if sets.isUseExternalBranding() else ""

casaAssets = {
"contextPath": "/casa",
"contextPath": "/jans-casa",
"prefix" : prefix,
"faviconUrl" : faviconUrl,
"extraCss": sets.getExtraCssSnippet(),
Expand Down
11 changes: 0 additions & 11 deletions jans-casa/extras/casa_web_resources.xml

This file was deleted.

19 changes: 2 additions & 17 deletions jans-linux-setup/jans_setup/setup_app/installers/jans_casa.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ class CasaInstaller(JettyInstaller):
(os.path.join(casa_dist_dir, 'jans-fido2-client.jar'), (os.path.join(base.current_app.app_info['JANS_MAVEN'], 'maven/io/jans/jans-fido2-client/{0}/jans-fido2-client-{0}.jar'.format(base.current_app.app_info['jans_version'])))),
]

casa_python_libs = ['Casa.py', 'casa-external_fido2.py', 'casa-external_otp.py', 'casa-external_super_gluu.py', 'casa-external_twilio_sms.py']

casa_script_files = []

for plib in casa_python_libs:
casa_script_files.append((
os.path.join(casa_dist_dir, 'pylib', plib),
os.path.join(CASA_GIT, 'extras', plib)
))

def __init__(self):
setattr(base.current_app, self.__class__.__name__, self)
self.service_name = 'jans-casa'
Expand All @@ -48,7 +38,6 @@ def __init__(self):
self.install_var = 'install_casa'
self.register_progess()

self.source_files += self.casa_script_files
self.output_folder = os.path.join(Config.output_dir, self.service_name)
self.templates_dir = os.path.join(Config.templateFolder, self.service_name)
self.ldif_config_fn = os.path.join(self.output_folder, 'configuration.ldif')
Expand All @@ -64,8 +53,8 @@ def install(self):

self.installJettyService(self.jetty_app_configuration[self.service_name], True)
self.copyFile(self.source_files[0][0], self.jetty_service_webapps)
self.copyFile(self.source_files[4][0], self.jetty_service_webapps)

base.extract_subdir(base.current_app.jans_zip, 'jans-casa/extras', self.pylib_dir)
self.casa_scopes = self.create_scopes()
self.add_plugins()
self.enable()
Expand All @@ -82,10 +71,6 @@ def add_plugins(self):
base.current_app.JansAuthInstaller.add_extra_class(plugin_class_path)
self.chown(plugin_class_path, Config.jetty_user, Config.jetty_group)

def copy_static(self):
for fn in glob.glob(os.path.join(self.casa_dist_dir, 'pylib/*.py')):
self.copyFile(fn, self.pylib_dir)


def generate_configuration(self):
self.casa_scopes = self.create_scopes()
Expand All @@ -103,7 +88,7 @@ def render_import_templates(self):
Config.templateRenderingDict['casa_frontchannel_logout_uri'] = f'https://{Config.hostname}/{self.service_name}/autologout'

# prepare casa scipt ldif
base64_script_file = self.generate_base64_file(self.casa_script_files[0][0], 1)
base64_script_file = self.generate_base64_file(os.path.join(self.pylib_dir, 'Casa.py'), 1)
Config.templateRenderingDict['casa_person_authentication_script'] = base64_script_file
self.renderTemplateInOut(self.ldif_auth_script_fn, self.templates_dir, self.output_folder)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.server.handler.ContextHandler">
<Set name="contextPath">%(service_name)s/custom</Set>
<Set name="contextPath">/%(service_name)s/custom</Set>
<Set name="handler">
<New class="org.eclipse.jetty.server.handler.ResourceHandler">
<Set name="resourceBase">%(jetty_service_dir)s/static</Set>
Expand Down

0 comments on commit 2775d6f

Please sign in to comment.