Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow developers to enable auto-login for their frontend #414

Merged

Conversation

pklaschka
Copy link
Member

@pklaschka pklaschka commented Jan 12, 2024

With this change, the setAutoLoginCredentials() function gets exposed as a public API. While it should be used with extreme care (since using it means hard-coding the NATS credentials into the built frontends), this enables developers to enable auto-login in their Telestion based frontends by calling:

setAutoLoginCredentials({
	natsUrl: 'ws://localhost:9222',
	username: 'nats',
	password: 'nats'
});

While there are, obviously, security risks associated with this, some use-cases require such functionality which is why it gets exposed as an official API to at least make it as secure as possible by tightly integrating it into the core framework. To make developers aware of the security implications, they are described in the documentation and the function is marked as @deprecated for extra attention.

Copy link
Member Author

pklaschka commented Jan 12, 2024

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

@pklaschka pklaschka self-assigned this Jan 12, 2024
@pklaschka pklaschka added 📕 documentation Improvements or additions to documentation 🌷 enhancement New feature or request labels Jan 12, 2024 — with Graphite App
Base automatically changed from 01-12-Restore_login_session_upon_reload to main January 17, 2024 16:53
Copy link
Member

@fussel178 fussel178 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🏑

With this change, the `setAutoLoginCredentials()` function gets exposed as a public API. While it should be used with extreme care (since using it means hard-coding the NATS credentials into the built frontends), this enables developers to enable auto-login in their Telestion based frontends by calling:

```tsx
setAutoLoginCredentials({
	natsUrl: 'ws://localhost:9222',
	username: 'nats',
	password: 'nats'
});
```

While there are, obviously, security risks associated with this, some use-cases require such functionality which is why it gets exposed as an official API to at least make it as secure as possible by tightly integrating it into the core framework. To make developers aware of the security implications, they are described in the documentation and the function is marked as `@deprecated` for extra attention.
@pklaschka pklaschka force-pushed the 01-12-Allow_developers_to_enable_auto-login_for_their_frontend branch from 2e14961 to dce62c6 Compare January 17, 2024 17:48
@pklaschka pklaschka merged commit 5159584 into main Jan 17, 2024
25 checks passed
@pklaschka pklaschka deleted the 01-12-Allow_developers_to_enable_auto-login_for_their_frontend branch January 17, 2024 17:48
Copy link
Member Author

Merge activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📕 documentation Improvements or additions to documentation 🌷 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants