The Remote Systems menu option lets you
You can find Vendor's information here.
Let's first create a connection to a remote system and call a sil script from this remote system.
I have two Jira instances running on localhost:2990/jira and localhost:8080.
I have this SIL script on localhost:8080 called test.sil:
logPrint("ERROR", "I am called from " + argv[0]);
This scripts accepts a parameter and logs an error message into the atlassian-jira.log file with a message which includes this parameter.
Now on localhost:2990/jira I go to cog item -> Manage Apps -> Remote Systems, push the Add Remote button and provide data for my localhost:8080 Jira instance:
Now push the Save button and create a script on localhost:2990/jira which will call the test.sil from localhost:8080:
call("my_ext_jira", "test.sil", "localhost:2990/jira")
The first parameter is the name of our connection (my_ext_jira).
The second parameter is the name of the script which will be executed on the remote system.
The third parameter is the additional parameter which will be passed to our test.sil and we will take the value of this parameter as argv[0].
Now let's run the script and have a look in the logs on localhost:8080. We will see the following line:
2020-05-25 08:30:57,944+0000 pool-38-thread-2 ERROR admin 510x101x1 3sauem 172.26.0.1 /rest/keplerrominfo/refapp/latest/async-script/runScript [c.k.s.lang.routines.LogPrintRoutine] I am called from localhost:2990/jira
It means that we successfully called a SIL script on localhost:8080 from localhost:2990/jira.
Next let's have a look at the Security section of the Remote Systems menu option.
Suppose we have two scripts on our localhost:2990/jira.
test.sil
call("my_ext_jira", "test.sil", "localhost:2990/jira")
test1.sil
runerLog("Hello World");
And also I have a user called user1 who does not have the Jira Administrator permission and I want this user to be able to execute inline scripts and sil scripts on the file system by SIL REST API.
Let's go to Remote Systems:
We will be working with the Grant execute inline, Grand read and Grant execute buttons from the Security section.
First let's try to execute an inline script by user1.
http://localhost:2990/jira/rest/keplerrominfo/refapp/1.0/async-script/runScript
With this JSON:
{
"source" : {
"type": "INLINE",
"code": "return 1;"
}
}
And we have the 403 Forbidden error.
Now let's push the Grant execute inline button and add this grant to user1:
And now we got the 200 response which means that the script was executed successfully.
Now let's try to execute the test1.sil file under user1. This time the JSON will look like this:
{
"source": {
"type": "FILE",
"code": "test1.sil"
}
}
And we get the 403 Forbidden error. Now let's permit user1 to execute the test1.sil file, push the Grant execute button:
Let's execute the script and this time the response code is 200.
You can provide a connection to your LDAP. You can find Vendor's information here.
I run a docker with a ldap server from here.
docker run -p 389:389 -p 636:636 --name my-openldap-container --env LDAP_ADMIN_PASSWORD="adminadmin" --detach osixia/openldap:1.3.0
Let's push the Add LDAP button and configure our connection:
The only available option for the Directory field is Active Directory. But it does not mean that you can make a connection only to Microsoft Active Directory. You can use any LDAP server. In my case I used open ldap.
Now we can select data from this ldap.
Let's try to select data with the ldapUserList routine:
runnerLog(ldapUserList({"cn", "uid"}, "objectClass=*", "myldap"));
And I successfully chose the admin user from my ldap.
Alexey Matveev
software developer
MagicButtonLabs
Philippines
1,574 accepted answers
0 comments