IHTSDO / component-identifier-service-legacy

A REST Server for managing the generation and assignment of Terminology Component Identifiers.
Other
1 stars 4 forks source link

crowd variables setup ? #23

Closed Myu-Unix closed 4 years ago

Myu-Unix commented 4 years ago

Hello dears,

Could you clarify what's expected on this step from the README ?

Setup Crowd credentials for the application in system variables with the following variable names:

Crowd URL: crowd_url
Crowd Application Name: app_name
Crowd Application Password: app_password

I did an export of those variable through the shell with export var=value

But the node app still won't start :

/home/admin/component-identifier-service/node_modules/atlassian-crowd/lib/index.js:15
    throw new Error("Missing Required Setting Crowd Base URL");
    ^

Error: Missing Required Setting Crowd Base URL
    at new AtlassianCrowd (/home/admin/component-identifier-service/node_modules/atlassian-crowd/lib/index.js:15:11)
    at Object.<anonymous> (/home/admin/component-identifier-service/blogic/Security.js:20:13)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/admin/component-identifier-service/controllers/BulkJob.js:7:16)

Many thanks in advance !

Cheers,

kaicode commented 4 years ago

Hi @Myu-Unix,

In our supervisor config we have something like this:

[program:cis]
user = cis
directory = /opt/cis
command = /usr/bin/node /opt/cis/app.js host=localhost dbName=idservice dbuser=idservice dbpass=xxx
environment=NODE_TLS_REJECT_UNAUTHORIZED=0,CROWD_URL=https://crowd.somedomain.com/crowd/,CROWD_APP_NAME=component-id-service,CROWD_APP_PASSWORD=xxxx
autostart = true
autorestart = true

So it appears the environment variables are CROWD_URL, CROWD_APP_NAME and CROWD_APP_PASSWORD presumably they need to be upper case. I can see these referenced here: https://github.com/IHTSDO/component-identifier-service/blob/1.2.4/blogic/Security.js#L8

The app name and password should match the settings in your Atlasian Crowd instance. For example:

Screenshot 2020-07-02 at 23 02 52

I hope this helps.

Kind regards, Kai Kewley

Myu-Unix commented 4 years ago

Hi Kai,

Thanks for the explanation, it "works" indeed (app is starting)

The README.md doesn't mention the good variable names so maybe it could use some love, I'll do a PR

Is it possible to have some kind of local auth to bypass Atlassian Crowd ? Any pointers you could share ?

Many thanks in advance :)

Cheers,

Laurent

kaicode commented 4 years ago

Hi Laurent, It should be possible to bypass the Crowd authentication by writing an alternative implementation for the AtlassianCrowd class here which has session.create, session.authenticate, session.destroy etc methods that return a hardcoded result but I'm not sure what the return types for those methods should be.

Some debugging and discovery by running it against Crowd and inspecting what comes back would give the information required to write an alternative implementation. Sorry I don't have a more useful suggestion, this project was written quite a few years ago by an external vendor and we do not have any other Node.js applications and I'm no expert.

If you are using Snowstorm there is a built in identifier service that can be used for extension authoring. This is enabled by default.

Myu-Unix commented 4 years ago

Hi Kai,

Thanks for the explanation !

Can you give us more details on how to use the built-in CIS within Snowstorm ? It doesn't seems to appear in the Swagger UI.

We are running Snowstorm 4.12.1 right now.

Cheers

kaicode commented 4 years ago

To use the built in SCTID generator in Snowstorm when you save new components just leave the id fields empty and Snowstorm will assign them. The new identifiers can be seen in the response.

Lotili commented 4 years ago

Hi Kai, Jumping in the discussion as I work with @Myu-Unix on the authoring and terminological aspects. That's very good to know, thanks! Is there any way to use our namespace in those automatically generated ID's? We will be creating modules and refsets soon and we need to make sure our content is compliant with SNOMED CT's authoring rules. Are these SCTID's random strings of digits, or is there a check on their structure and their compliance with existing SCTID's ? Thanks in advance

kaicode commented 4 years ago

Hi @Lotili,

Rather than responding here I'll update my answer to your question from March last year so others using the Snowstorm project can find the information more easily https://github.com/IHTSDO/snowstorm/issues/32

Cheers, Kai