Skip to content

Commit

Permalink
fix: update scripts (#765)
Browse files Browse the repository at this point in the history
* fix: update scripts

* fix: update scripts

* fix: update scripts
  • Loading branch information
moabu authored Feb 7, 2022
1 parent 5950a26 commit 8b9aaca
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 13 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,47 @@ on:
- update-source-build-date
workflow_dispatch:
jobs:
release-chart-pr:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
fail-fast: false
matrix:
charst: ["charts/janssen" ]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.MOAUTO_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.MOAUTO_GPG_PRIVATE_KEY_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true

- name: Configure Git
run: |
git config user.name "mo-auto"
git config user.email "54212639+mo-auto@users.noreply.github.com"
git config --global user.signingkey "${{ steps.import_gpg.outputs.keyid }}"
- uses: google-github-actions/release-please-action@v3.1
id: release-please
with:
path: ${{ matrix.charts }}
token: ${{ secrets.MOWORKFLOWTOKEN }}
release-type: helm
package-name: ${{ matrix.charts }}
monorepo-tags: true
release-docker-pr:
needs: release-chart-pr
runs-on: ubuntu-latest
strategy:
max-parallel: 1
fail-fast: false
matrix:
docker-images: [ "docker-jans-auth-server", "docker-jans-certmanager", "docker-jans-config-api", "docker-jans-client-api", "docker-jans-configurator", "docker-jans-fido2", "docker-jans-persistence-loader", "docker-jans-scim" ]
Expand Down Expand Up @@ -44,8 +82,10 @@ jobs:
package-name: ${{ matrix.docker-images }}
monorepo-tags: true
release-python-pr:
needs: release-docker-pr
runs-on: ubuntu-latest
strategy:
max-parallel: 1
fail-fast: false
matrix:
python-projects: ["jans-pycloudlib", "jans-cli"]
Expand Down
18 changes: 9 additions & 9 deletions docker-jans-auth-server/libs/casa-external_fido2.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def init(self, customScript, configurationAttributes):
#self.fido2_domain = None
#if configurationAttributes.containsKey("fido2_domain"):
# self.fido2_domain = configurationAttributes.get("fido2_domain").getValue2()

self.metaDataLoaderLock = ReentrantLock()
self.metaDataConfiguration = None

print "Fido2. Initialized successfully"
return True
return True

def destroy(self, configurationAttributes):
print "Fido2. Destroy"
Expand Down Expand Up @@ -205,13 +205,13 @@ def getPageForStep(self, configurationAttributes, step):

def logout(self, configurationAttributes, requestParameters):
return True

def getMetaDataConfiguration(self):
if self.metaDataConfiguration != None:
return self.metaDataConfiguration

self.metaDataLoaderLock.lock()
# Make sure that another thread not loaded configuration already
# Make sure that another thread not loaded configuration already
if self.metaDataConfiguration != None:
return self.metaDataConfiguration

Expand All @@ -221,7 +221,7 @@ def getMetaDataConfiguration(self):
#self.fido2_server_metadata_uri = self.fido2_server_uri + "/oxauth/restv1/fido2/configuration"

metaDataConfigurationService = Fido2ClientFactory.instance().createMetaDataConfigurationService(self.fido2_server_metadata_uri)

max_attempts = 10
for attempt in range(1, max_attempts + 1):
try:
Expand All @@ -231,12 +231,12 @@ def getMetaDataConfiguration(self):
# Detect if last try or we still get Service Unavailable HTTP error
if (attempt == max_attempts) or (ex.getResponse().getResponseStatus() != Response.Status.SERVICE_UNAVAILABLE):
raise ex

java.lang.Thread.sleep(3000)
print "Attempting to load metadata: %d" % attempt
finally:
self.metaDataLoaderLock.unlock()

# Added for Casa compliance

def hasEnrollments(self, configurationAttributes, user):
Expand Down
6 changes: 3 additions & 3 deletions docker-jans-auth-server/libs/casa-external_super_gluu.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from io.jans.as.server.util import ServerUtil
from io.jans.util import StringHelper
from io.jans.service import MailService
from io.jans.as.service.push.sns import PushPlatform, PushSnsService
from io.jans.as.service.push.sns import PushPlatform, PushSnsService
from io.jans.oxnotify.client import NotifyClientFactory

from java.util import Arrays, HashMap, IdentityHashMap, Date
Expand Down Expand Up @@ -113,7 +113,7 @@ def init(self, customScript, configurationAttributes):
self.audit_attribute = configurationAttributes.get("audit_attribute").getValue2()

self.valid_license = False
# Removing or altering this block validation is against the terms of the license.
# Removing or altering this block validation is against the terms of the license.
if has_license_api and configurationAttributes.containsKey("license_file"):
license_file = configurationAttributes.get("license_file").getValue2()

Expand All @@ -126,7 +126,7 @@ def init(self, customScript, configurationAttributes):
return False
finally:
f.close()

# Validate license
try:
self.license_content = LicenseValidator.validate(license["public-key"], license["public-password"], license["license-password"], license["license"],
Expand Down
2 changes: 1 addition & 1 deletion docker-jans-auth-server/libs/casa-external_twilio_sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def sendMessage(self, code, numb):
try:
if numb[:1] != "+":
numb = "+" + numb

print "TwilioSMS. Sending SMS message (%s) to %s" % (code, numb)
msg = "%s is your passcode to access your account" % code
message = TwMessage.creator(PhoneNumber(numb), PhoneNumber(self.from_no), msg).create()
Expand Down

0 comments on commit 8b9aaca

Please sign in to comment.