go to post Sergei Shutov · Dec 14, 2022 Looks like it doesn't work with single file kits https://docs.intersystems.com/iris20222/csp/docbook/DocBook.UI.Page.cls?...
go to post Sergei Shutov · Dec 13, 2022 Have some fun,And delete one,65535 lines of code in the project!
go to post Sergei Shutov · Sep 7, 2022 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: http://localhost:57772/api/atelier/ You can also try to ask WRC privately if above option is not suitable for any reason.
go to post Sergei Shutov · Aug 29, 2022 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.
go to post Sergei Shutov · Jul 28, 2022 Hi Michael, You should have one top-level dispatch class which will dispatch individual API calls to separate endpoint classes. <!-- teapots --> <Map Prefix="/teapots" Forward="REST.Teapots"/> <!-- kettles --> <Map Prefix="/kettles" Forward="REST.Kettles"/>
go to post Sergei Shutov · Apr 11, 2022 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.
go to post Sergei Shutov · Apr 11, 2022 This is true for this particular version of Ensemble, but in IRIS this behaviour has changed -- even Embedded queries are using Dynamic SQL now. See discussion here https://community.intersystems.com/post/what-happened-embedded-sql
go to post Sergei Shutov · Apr 11, 2022 $translate(str,"""","") https://docs.intersystems.com/iris20212/csp/docbook/Doc.View.cls?KEY=RCO...
go to post Sergei Shutov · Mar 1, 2022 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. CheersSergei ShutovBanksia Globalhttps://banksiaglobal.com
go to post Sergei Shutov · Nov 14, 2021 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)
go to post Sergei Shutov · Nov 9, 2021 Hi Evgeny, this is very much dependent on how you log in :) If you are using "basic auth" method directly from browser (where it will prompt you for login/password once), you can change username by using "username@" in address bar, for example http://userB@127.0.0.1/my/api/ Hope this helps!=Sergei ShutovBanksia Global | https://banksiaglobal.com
go to post Sergei Shutov · Oct 26, 2021 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?
go to post Sergei Shutov · Oct 21, 2021 Can you please post your docker-compose.yml? Or at least part relevant to IRIS
go to post Sergei Shutov · Oct 19, 2021 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.
go to post Sergei Shutov · Oct 15, 2021 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.
go to post Sergei Shutov · Oct 15, 2021 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!
go to post Sergei Shutov · Oct 14, 2021 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.
go to post Sergei Shutov · Oct 14, 2021 This is what I do to generate JWTs. ClassMethod GetJWT(username As %String) As %String { // Calculate the issued at and expiration dates set iat = ##class(%OAuth2.Utils).TimeInSeconds($ztimestamp,0) set exp = ##class(%OAuth2.Utils).TimeInSeconds($ztimestamp,3600*24*7) // Define token payload set payload = { "iat": (iat), "iss": "zpmhub", "exp": (exp), "user": (username) } set secret=$get(^JWTSecret) if secret="" { set secret=##class(%PopulateUtils).StringMin(64,64) set secret=$tr($p($SYSTEM.Encryption.Base64Encode(secret,1),"=",1),"+/","-_") set ^JWTSecret=secret } set JOSE("sigalg")="HS256" do ##class(%OAuth2.JWKS).AddOct("HS256",secret,.RemotePrivate) do ##class(%OAuth2.JWT).ObjectToJWT(.JOSE,payload,,.RemotePrivate,.jwt) quit jwt }