Sergei Shutov · Sep 7, 2022 go to post

There are few reasons superserver API is not publicly documented, one of them is to prevent an easy discoverability of outdated instances outside firewalls by hackers. You can use Atelier API with relatively recent Cache/IRIS, which answers on Web server port and has support for authentication and will return version of Cache/IRIS it's running on, for example:

You can also try to ask WRC privately if above option is not suitable for any reason.

Sergei Shutov · Aug 29, 2022 go to post

SAM was built as a "gateway" to proper custom Prometheus/Grafana setup for cases when you only need to monitor IRIS. If you are building more complex solution, with non-InterSystems sources, I would recommend to set up Prometheus separately from SAM and just add SAM monitoring endpoints there.

Sergei Shutov · Jul 28, 2022 go to post

Hi Michael,

You should have one top-level dispatch class which will dispatch individual API calls to separate endpoint classes.

<!--teapots-->
<MapPrefix="/teapots"Forward="REST.Teapots"/>

 

<!--kettles-->
<MapPrefix="/kettles"Forward="REST.Kettles"/>
Sergei Shutov · Apr 11, 2022 go to post

David's answer is not quite correct because one can't use $translate to search for groups of symbols (like two quotes next to each other), this is what $replace function is for. $translate always search for an individual character.

Sergei Shutov · Mar 1, 2022 go to post

Hi Tom,

You need to contact TRC for this one, since it will depend slightly on the Version and Edition you are using, and will most probably involve some custom code to map your AD role structure into TrakCare's security groups. They will be able to guide you in the right direction.

Cheers
Sergei Shutov
Banksia Global
https://banksiaglobal.com

Sergei Shutov · Nov 14, 2021 go to post

You can try using DBF utility from my old Cache-based framework:

https://github.com/logist/p6/blob/master/classes/p6/Dbf.xml

It has ReadFile/ReadStream & WriteFile/WriteStream methods

Usage:

set sc=##class(p6.Dbf).WriteFile(file,array)
sc - execution status %Status
file-file name
array - string containing a name of global with data,
 
for example: ^asd("asdf"),
^CacheTemp($job,"dbf")
this array has to provide the following structure
...,"header")=<header>
format $list($list(var1,length1,type1,dec1),...,$list(varN,lengthN,typeN,decN)); type is D for date N for number anything else for string
...,"row",<row number>)=<data>

data format $list(var1,...,varN)

Sergei Shutov · Oct 26, 2021 go to post

The one I posted above with hs256 did work, I didn't try RSA ones. Can you post your code that produces a wrong signature?

Sergei Shutov · Oct 21, 2021 go to post

Can you please post your docker-compose.yml? Or at least part relevant to IRIS

Sergei Shutov · Oct 19, 2021 go to post

If you are talking about header (first part of 3-part JWT token) ObjectToJWT should generate correct values for you with alg, typ and x5t values set correctly.

If you are talking about payload (second part), I construct it after // Define token payload line in the example above and then pass it as 2nd argument to ObjectToJWT - you can add any data you need there.

Sergei Shutov · Oct 15, 2021 go to post

Well in case of $classmethod you don't need to use an indirection at all to achieve the same result. I would avoid using indirection if at all possible.

Sergei Shutov · Oct 15, 2021 go to post

In your case sigalg will be RS256 instead of HS256 and you'll need to call ##class(%OAuth2.JWKS).AddX509 instead of ##class(%OAuth2.JWKS).AddOct to use your private RSA keys.

It's definitely a bit of a challenge, but should be doable!

Sergei Shutov · Oct 14, 2021 go to post

All classes are ProcedureBlock by default, you need to manually set [Not ProcedureBlock] if you don't want to compile classes to Procedures. It's highly recommended to use ProcedureBlock though.

Sergei Shutov · Oct 14, 2021 go to post

This is what I do to generate JWTs.

ClassMethodGetJWT(usernameAs%String) As%String
{
// Calculate the issued at and expiration dates
setiat = ##class(%OAuth2.Utils).TimeInSeconds($ztimestamp,0)
setexp = ##class(%OAuth2.Utils).TimeInSeconds($ztimestamp,3600*24*7)

 

// Define token payload
setpayload = {
"iat": (iat),
"iss": "zpmhub",
"exp": (exp),
"user": (username)
}
setsecret=$get(^JWTSecret)
ifsecret="" {
setsecret=##class(%PopulateUtils).StringMin(64,64)
setsecret=$tr($p($SYSTEM.Encryption.Base64Encode(secret,1),"=",1),"+/","-_")
set^JWTSecret=secret
}
setJOSE("sigalg")="HS256"
do##class(%OAuth2.JWKS).AddOct("HS256",secret,.RemotePrivate)
do##class(%OAuth2.JWT).ObjectToJWT(.JOSE,payload,,.RemotePrivate,.jwt)
quitjwt
}
Sergei Shutov · Oct 12, 2021 go to post

Hi Muhammad,

You should look at csvgen package by @Evgeny.Shvarovhttps://github.com/evshvarov/csvgen

There are a few examples of importing data from GitHub on the home page. You can have a look at the source code to see how it's done if you need more flexibility.

Sergei Shutov · Sep 16, 2021 go to post

Hi Sai Sai,

One thing you might look into in regards to distribution and deployment is ZPM Package Manager https://github.com/intersystems-community/zpm . It's still under active development, but is already very usable at the moment, you can use it with a self-hosted open source private registry https://github.com/intersystems-community/zpm-registry/ and my consultancy is currently developing a commercial hosted version which will be announced at Virtual Summit next month.

There is an example of an Interoperability packaging at GitHub: https://github.com/intersystems-community/iris-interoperability-template

In terms of deployment, unless you have MASSIVE productions, I would recommend to deploy the whole thing at once even if not everything has changed -- it's just a lot less moving parts and options for errors this way, and you can test deployments on your test server as many times as you like.

Hope this helps!

Sergei Shutov
Managing Director, Banksia Global
https://banksiaglobal.com

Sergei Shutov · Jul 6, 2021 go to post

Did you try to rebuild indices and purge cached queries?

Also, have a look at the execution plan in the Management portal -- it will tell you which indices it uses and how it builds a result.

Sergei Shutov · Jul 6, 2021 go to post

Try this way

K  $ZT="^%ET"   
  id="{id}"
  set httprequest = ##class(%Net.HttpRequest).%New()
 set httprequest.SSLConfiguration = "HTTPS"
  set httprequest.Server = "anypoint.mulesoft.com" /// CHANGED
 set httprequest.Https = 1
 set httprequest.ContentType="json"
set sc=httprequest.SetHeader("Connection","close")
set status = httprequest.Get("/mocking/api/v1/links/03a74865-d7fb-4318-a310-7ad2b95361f6/v1/receivables/"_id") /// CHANGED
if status {
response=httprequest.HttpResponse //IS JUST RETURNING PAGE
     do response.Data.Rewind()
     do {
     write response.Data.Read()
     while 'response.Data.AtEnd 
}
 quit

Sergei Shutov · Jul 5, 2021 go to post

I believe this error happen because you are trying to execute this code in the class method, not instance method.

Can you please provide a full class definition and how you are executing the test?

Sergei Shutov · May 16, 2021 go to post

Hi Adrian,

Multi factor authentication can be enabled if you use single sign on or LDAP in TrakCare and your auth provider supports it. Please contact TRC for details.

Sergei Shutov · May 10, 2021 go to post

Hi Ishan,

1) - There is Trak documentation but it's not publicly available, you need to get access via TRC https://trc.intersystems.com/

2) There are no settings for fonts/colours, you need to use custom CSS file to change those