Question Michael Davidovich · Dec 11, 2024 Multiple %CSP.REST.AccessCheck() Overrides I have a primary dispatch class that implements %CSP.REST.AccessCheck() for some high level access checks before the route table forwards the request to the implementation classes which also implement %CSP.REST.AccessCheck() for some lower level access checks. The idea is that we know where we are in the implementation class and what the user is trying to do, so it makes more sense to check some lower level items there rather than trying to parse out the request at the dispatch class. #REST API #InterSystems IRIS 0 5 0 58
Question Michael Davidovich · Apr 24, 2024 Line Terminators and File/Stream Classes - A Few Questions Hello, I'm curious to see how other people deal with this: we have a text file that was created on someone's Windows machine and it was copied and pasted into a text file on someone's Mac machine. After some examination we realized that the line feeds were originally CRLF (for Windows) and when copied and pasted they were changed to LF (Mac). The diff program we used didn't pick up on this and the program we wrote to read the file was getting each line of the CRLF file and treating the whole file as one line for the LF file. #ObjectScript #Caché #InterSystems IRIS 0 2 0 141
Question Michael Davidovich · Mar 21, 2024 OAuth 2.0 Resource Service Scope Check Fail Hello, I have my server setup a resource server. When a user calls our API they submit a bearer token as authorization and in our dispatch class AccessCheck() we validate the JWT using ##class(%SYS.OAuth2.Validation).ValidateJWT(). If I include a scope to check in that method I get the error Scope check may only be done on requesting client and I'm not sure what this means. The method works without include the scope and will let me know if I have an unsigned token or an expired token. #OAuth2 #Security #InterSystems IRIS 0 5 0 239
Question Michael Davidovich · Sep 20, 2023 Access Ens.MessageHeader on Error in Business Service When making a synchronous request to a custom business process and there's an error and 0 is returned, it seems that the response is not sent back to the custom business service. Rather, a Ens.MessageHeader with IsError=1 is returned without a message body (which would normally be the response object). #Ensemble 0 2 0 196
Question Michael Davidovich · Aug 21, 2023 Ambiguous sort column error <csp:search> A bit of an old school CSP question. <csp:search> is a really nice, quick way to make easy lookups for CSP pages, especially for back office stuff that doesn't need to look pretty for the modern web app user. At any rate, I'm here at the moment: #CSP #SQL #InterSystems IRIS 0 3 0 159
Question Michael Davidovich · Aug 11, 2023 OnPre/Before/After Method in %CSP.REST for Common Code? I have tried many methods from super classes of %CSP.REST but I can't find a method I can override that will run after the %response object is created so I can set a header that is common to each implementation method. It's one line of code in each method to set the header but it would like to make it super easy, simple and just have a method that runs on, before, after the implementation method to set this common header (we want to return the API version in each responses HTTP headers. #REST API #InterSystems IRIS 0 2 0 176
Question Michael Davidovich · Jul 18, 2023 Custom Business Process Required Methods I am hoping someone can let me know if I've gone down a dark path or not: #Interoperability #InterSystems IRIS 0 3 0 294
Question Michael Davidovich · Jun 2, 2023 %OAuth2.JWT Methods/OAuth 2.0 Questions This is a bit of an IRIS question but also and OAuth 2.0 questions: I am using %OAuth2.JWT.JWTToObject() to "validate" a JWT. My questions: - While I am checking claims with the returned body, does the return status of the method "count" as a validation step? In other words, if I weren't checking claims and $$$OK was returned from that method call (passing in the token and public keys), I could feel confident that this token came from the expected auth server? #OAuth2 #InterSystems IRIS 0 4 0 297
Question Michael Davidovich · Apr 21, 2023 REST API Versioning in Header I have seen this post and appreciate that discussion: API RESTful Version | InterSystems Developer Community | Business Service However our org requirement is for a caller to provide the API version in the HTTP request header. I am finding the cleanest way to route to the correct class using the header version. My classes are setup as API.Service.v1 API.Service.v2 #REST API #InterSystems IRIS 0 2 0 236
Question Michael Davidovich · Mar 30, 2023 %External.Messaging and Kafka I am trying to write a message to a Kafta cluster programmatically (i.e. not in Ensemble or using a Production) using %External.Messaging. I am consistently getting a 'topic not found error' even though I have created the topic on the cluster. I dug into the client I created an when accessing the property KaftaClient.jclient.gateway I get the following output: #Java #InterSystems IRIS 0 4 0 430
Question Michael Davidovich · Feb 28, 2023 %session.Data killed after redirect Any ideas on why my %session.Data array would be wiped out after setting %response.Redirect in OnPreHTTP()? #CSP #Caché #InterSystems IRIS 0 8 0 1.3K
Question Michael Davidovich · Jan 31, 2023 Set OpenAPI Properties with GET /api/mgmnt/v1/:namespace/spec/:application/ When manually coding REST services and using GET /api/mgmnt/v1/:namespace/spec/:application/ to return an OpenAPI spec, how do you specify supported properties (OpenAPI Properties in Use | Creating REST Services | InterSystems IRIS Data Platform 2021.1) like responses, definitions, and information in paths like summary and description? #API #CSP #REST API #InterSystems IRIS #InterSystems IRIS for Health 0 7 1 306
Question Michael Davidovich · Nov 15, 2022 Null Response from Request to Built-In Business Operation I am sending an HL7 message from a BPL transform operation to a business operation that uses EnsLib.HL7.Operation.FileOperation. #Interoperability #InterSystems IRIS for Health 0 3 0 300
Question Michael Davidovich · Nov 14, 2022 Business Service Pool Size with Ens.Director.CreatBusinessService() I have created a business service that uses an adaptor that I wrote by extending Ens.InboundAdapter (i.e. the ADAPTOR parameter is set to my custom adaptor ). The OnTask() method of my adaptor polls our IRIS database to determine which records are ready to be sent out of our system to an external target system. If the record is ready the OnTask() method creates an instance of the Business Service and then calls the OnProcess() method sending in the record as the input. #Interoperability #Ensemble 0 2 0 440
Question Michael Davidovich · Oct 31, 2022 Using %session with /api/mgmnt/ Service generated classes Sessions and specifically %session are paramount to our application to login users to the application (the Web Gateway user logs into the server and then users login to the application). #REST API #InterSystems IRIS 0 11 0 399
Question Michael Davidovich · Aug 26, 2022 Missing Ensemble Classes in IRIS for Health Community Docker Hello, I'm using CircleCI to spin up the image `store/intersystems/irishealth-community:2021.2.0.649.0`. When building the application we are getting messages that say: ERROR #5373: Class 'EnsLib.HL7.Message', used by 'Package.Class', does not existSkip class Package.Class Other missing classes seem to include, but not limited to: Ens.BusinessProcessBPLEns.BusinessServiceEnsLib.RecordMap.ComplexChildEnsLib.EDI.XML.DocumentEns.Request #Docker #Key Question #InterSystems IRIS for Health 0 19 0 428
Question Michael Davidovich · Aug 16, 2022 Zen - Manipulate a result set for Zen report? Have a Zen report with a huge query that we are trying to break down and be more efficient. Looks like Zen only wants to take a result set class as the data (or XML, but writing to a file to generate these reports is probably even more overhead). Is there a way I can move through a result set object, delete rows I don't want based on some objectscript commands and the pass that to the report? Or can I pass a dynamic object? Thanks. #ZEN #InterSystems IRIS 0 3 0 277
Question Michael Davidovich · Aug 12, 2022 Return Error Code After Unit Tests to CircleCI Job Does anyone have experience with CircleCI or really any automation tool using %UnitTest? I have built my app and ran my unit test in a Docker container automated by CircleCI. However, after many of the tests failed I see: How do you halt out of the IRIS session and return an exit code to the shell? I have a script in my repo that I pass into IRIS after CircleCI does the code checkout iris session IRIS < inFile #DevOps #Testing #InterSystems IRIS for Health 0 8 0 462
Question Michael Davidovich · Jul 29, 2022 Opinions on CSP methods to REST services? What are other's thoughts, opinions and experiences going from CSP to RESTful services, specifically when it comes to reusing code in CSP files? One could define a method in CSP as follows: <script language="cache" method="SubmitSomethingAwesome" arguments="aswesomeId:%Numeric"> And it's generated in csp.mycsppage.cls ascsp.mycsppage.SubmitSomethingAwesome(awesomeId as %Numeric). Have people had success defining there rest call by calling the generated CSP classmethod? Things that work well I've found: #CSP #REST API #InterSystems IRIS for Health 0 3 0 402
Question Michael Davidovich · Jul 27, 2022 %REST disp.cls, apps, and packages - How to structure? After some trials, I am comfortably on my way developing spec first REST APIs using /api/mgmt/, OpenAPI 2.0, testing with Postman. My question is related to scaling up. Assume these things: - Our software is CSP web app and it's web application is '/csp/application' - I created a new REST enabled web app called '/csp/application/v1' and for my first API I created a spec that defines an endpoint /getTeapots so the endpoint is localhost/csp/application/v1/getTeapots - Using the /api/mgmt/ endpoint, I loaded the spec into API.TeapotLibrary #REST API #InterSystems IRIS for Health 0 6 0 465