Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(jans-linux-setup): load new pure java sample custom script during setup with tests #1332

Closed
yuriyz opened this issue May 16, 2022 · 1 comment
Assignees
Labels
comp-jans-linux-setup Component affected by issue or PR kind-feature Issue or PR is a new feature request

Comments

@yuriyz
Copy link
Contributor

yuriyz commented May 16, 2022

Description

There is pure java Discovery.java sample script which has to be loaded into persistence during setup with tests (on jenkins)

https://github.com/JanssenProject/jans/blob/main/jans-linux-setup/jans_setup/static/extension/discovery/Discovery.java

Note that when setup with tests it must be enabled (jansEnabled: TRUE) while during normal setup it should be disabled (jansEnabled: FALSE).

Result LDIF has to look as following

dn: inum=0300-BA90,ou=scripts,o=jans
objectClass: jansCustomScr
objectClass: top
description: Java Custom Sample Script
displayName: discovery_java_params
inum: 0300-BA90
jansEnabled: TRUE
jansLevel: 1
jansModuleProperty: {"value1":"location_type","value2":"ldap","description":
 ""}
jansProgLng: java
jansRevision: 11
jansScr:: aW1wb3J0IGlvLmphbnMubW9kZWwuU2ltcGxlQ3VzdG9tUHJvcGVydHk7DQppbXBvcn
 QgaW8uamFucy5tb2RlbC5jdXN0b20uc2NyaXB0Lm1vZGVsLkN1c3RvbVNjcmlwdDsNCmltcG9yd
 CBpby5qYW5zLm1vZGVsLmN1c3RvbS5zY3JpcHQudHlwZS5kaXNjb3ZlcnkuRGlzY292ZXJ5VHlw
 ZTsNCmltcG9ydCBpby5qYW5zLnNlcnZpY2UuY3VzdG9tLnNjcmlwdC5DdXN0b21TY3JpcHRNYW5
 hZ2VyOw0KaW1wb3J0IG9yZy5zbGY0ai5Mb2dnZXI7DQppbXBvcnQgb3JnLnNsZjRqLkxvZ2dlck
 ZhY3Rvcnk7DQppbXBvcnQgb3JnLmpzb24uSlNPTk9iamVjdDsNCg0KaW1wb3J0IGphdmEudX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XJhdGlvbkF0dHJ
 pYnV0ZXMpIHsNCiAgICAgICAgbG9nLmluZm8oIkRlc3Ryb3kgb2YgRGlzY292ZXJ5IEphdmEgY3
 VzdG9tIHNjcmlwdCIpOw0KICAgICAgICByZXR1cm4gdHJ1ZTsNCiAgICB9DQoNCiAgICBAT3Zlc
 nJpZGUNCiAgICBwdWJsaWMgaW50IGdldEFwaVZlcnNpb24oKSB7DQogICAgICAgIGxvZy5pbmZv
 KCJnZXRBcGlWZXJzaW9uIERpc2NvdmVyeSBKYXZhIGN1c3RvbSBzY3JpcHQ6IDExIik7DQogICA
 gICAgIHJldHVybiAxMTsNCiAgICB9DQoNCiAgICBAT3ZlcnJpZGUNCiAgICBwdWJsaWMgYm9vbG
 VhbiBtb2RpZnlSZXNwb25zZShPYmplY3QgcmVzcG9uc2VBc0pzb25PYmplY3QsIE9iamVjdCBjb
 250ZXh0KSB7DQogICAgICAgIHNjcmlwdExvZ2dlci5pbmZvKCJ3cml0ZSB0byBzY3JpcHQgbG9n
 Z2VyIik7DQogICAgICAgIEpTT05PYmplY3QgcmVzcG9uc2UgPSAoSlNPTk9iamVjdCkgcmVzcG9
 uc2VBc0pzb25PYmplY3Q7DQogICAgICAgIHJlc3BvbnNlLmFjY3VtdWxhdGUoImtleV9mcm9tX2
 phdmEiLCAidmFsdWVfZnJvbV9zY3JpcHRfb25famF2YSIpOw0KICAgICAgICByZXR1cm4gdHJ1Z
 TsNCiAgICB9DQp9DQo=
jansScrTyp: discovery
@yuriyz yuriyz added kind-feature Issue or PR is a new feature request comp-jans-linux-setup Component affected by issue or PR labels May 16, 2022
@devrimyatar
Copy link
Contributor

Implemented in 60cb36c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-jans-linux-setup Component affected by issue or PR kind-feature Issue or PR is a new feature request
Projects
None yet
Development

No branches or pull requests

2 participants