ioBroker / ioBroker.node-red

Instantiate the server with node-red
Apache License 2.0
52 stars 27 forks source link

Added extended authentication #294

Closed Bannsaenger closed 2 years ago

Bannsaenger commented 2 years ago

Added extended authentication. The existing "Simple" authentication is still working. If user is empty the authentication type wil be set to "None" with the first start of the instance config. Question: I added the translations to the words.js Wich is the right way to do the translation. words.js or the i.18n folder, or could it be transferred automatically ? Thanks.

lgtm-com[bot] commented 2 years ago

This pull request introduces 1 alert when merging 69f72aa43132dc34e3bd6b93d4b6f3c2ae1e7cbd into 7619560aaee8c2babfae10da6f6ad2205578eebf - view on LGTM.com

new alerts:

Apollon77 commented 2 years ago

For translations: normally just add to the i18n/en file and then execute node node_modules/.bin/gulp translateAndUpdateWordsJS(assumed you have done npm install in adapter folder before)

Apollon77 commented 2 years ago

But I can also update the translation file after words.js changes ... works eighter way (just not mixed) :-)

Apollon77 commented 2 years ago

I think if doing that way we should at least store the passwords encrypted because they are unencrypted in the instance object ... for this you need to get the secret and then define own methods like in https://github.com/Apollon77/ioBroker.meross/blob/master/admin/index_m.html#L34-L56 and use them in admin page ... ad a comparable decrypt in the adapter logic.

The automatic encrypt/decrypt will not work here because it is "not static fieldnames"

Bannsaenger commented 2 years ago

The passwords are ready encryted for node-red. I think it's save enough because the passwords reside in the settings.js from node red the same way.

Apollon77 commented 2 years ago

ahah now you say it I see it ... good

Apollon77 commented 2 years ago

PR looks good ... ready to merge when you are :-)

Bannsaenger commented 2 years ago

If you can do the words to i18n then im finished yet.

Apollon77 commented 2 years ago

kk, thx!! wil merge as soon as we verified another topic

Apollon77 commented 2 years ago

@Bannsaenger Please have a last look https://github.com/ioBroker/ioBroker.node-red/commit/4d579f1bf8fc401233c194220f94a773accf7fad

I also added the fallback logic to main.js

makes sense that way?

Bannsaenger commented 2 years ago

That makes sense, Thanks