kontent-ai / model-generator-net

Kontent.ai .NET model generator.
https://www.nuget.org/packages/Kontent.Ai.ModelGenerator
MIT License
17 stars 19 forks source link

Allow to run the tool against the Secure Delivery API #94

Closed hugobarona closed 4 years ago

hugobarona commented 4 years ago

Motivation

By default, my client uses Kentico projects with secure option enabled, and sometimes we need to disable it in order to run this tool, whereas preferably it would be good to do not be required to disable it.

Proposed solution

Allow to send the api-key as parameter when running the tool, so it can run against the Secure Delivery API.

petrsvihlik commented 4 years ago

Hi @hugobarona , thank you for the feedback!

It is possible to use the tool together with the secure API. Just modify the appconfig.json:

https://github.com/Kentico/kontent-generators-net/blob/master/src/Kentico.Kontent.ModelGenerator/appSettings.json

I'll make sure this option is more visible in the documentation (readme, etc.)

Please let me know if it solves your issue, thanks!

hugobarona commented 4 years ago

Hi @petrsvihlik,

if you consider following the recommended way to use the tool, so installing it as a .NET Core Global Tool, then you need arguments when running the tool to be able to specify the key.

That's what i mean. Of course in the code, you can do anything. Anyway, if i have some time, i can contribute with this change for you guys, if you don't implement it before. Thanks

petrsvihlik commented 4 years ago

@hugobarona absolutely agreed. I'll have a quick peek into this topic today and will let you know. It's a bit more complex as we'd like to replace the command-line parsing library too (#93)

petrsvihlik commented 4 years ago

95 - fix

petrsvihlik commented 4 years ago

Is this solution acceptable?

https://github.com/Kentico/kontent-generators-net#advanced-configuration-preview-api-secure-api

petrsvihlik commented 4 years ago

feel free to reopen the issue if you run into any problems

hugobarona commented 4 years ago

@petrsvihlik i presume the argument for the key was not introduced in the command args right?

petrsvihlik commented 4 years ago

you can configure any of the DeliveryOptions properties this way

e.g. --DeliveryOptions:SecureAccessApiKey xyz