educloudalliance / xroad-rest-gateway

Unmaintained repository. Development moved to
https://github.com/vrk-kpa/REST-adapter-service
European Union Public License 1.1
20 stars 11 forks source link

Consumer Gateway and X-XRd-Client #27

Open eramirez-sv opened 7 years ago

eramirez-sv commented 7 years ago

Hi, I am trying to understand how to the rest adapter works. I have edited consumer-gateway.properties to match my security server and sample subsystem "SV.GOB.1001.testquery". This works as expected and I am also able to pass different services to which my subsystem has been granted access. Now, I would like to use a different subsystem, I don't see a way to add multiple client ids inside consumer-gateway.properties. I've tried commenting out the id.client value inside consumer.properties and passing de X-XRd-Client header, but it gets ignored:

11.04.2017 16:40:28 WARN ConfigurationHelper : Client can not be null. 11.04.2017 16:40:28 WARN ConsumerGatewayUtil : ConsumerMember not found.

Am I missing something or this functionality is not implemented yet?

Thanks in advance for your help.

petkivim commented 7 years ago

Hi,

Unfortunately multiple client ids are not supported at the the moment. Currently the ConsumerGateway supports only one client subsystem that is set through consumer-gateway.proterties just like you have done. However, this is something that can be developed in the future. @hanhaka @iluwatar

Thanks. Petteri

hanhaka commented 7 years ago

This is very interesting and good enhancement to REST gateway component, definitely something that is worth to at least investigate and possible implement hopefully soon. I have created a new ticket for this one to our development backlog (Suomi.fi-palveluväylä X-Road development backlog). Not sure yet what is the implementation schedule but I keep this in my mind when prioritizing the work queue.

Thanks, Hannu

eramirez-sv commented 7 years ago

Thanks for your reply, I am able to use different clients using the N.id.client properties in consumers.properties. This solves my problem, I think it makes sense to allow different clients. Regards,

petkivim commented 7 years ago

Yes, you're right. You can use x.id.client property in the consumers.properties file for overriding the default client id that's set in consumer-gateway.properties file. However, you can set only one client id for each consumer endpoint. If you need to allow multiple client id's for a single endpoint unfortunately that's not currently supported. As a workaround you can create multiple endpoints using the same x.id, but different x.id.client and x.path.

Thanks. Petteri