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

banner instead of comment? #205

Closed
dezren39 opened this issue Jan 1, 2024 · 1 comment · Fixed by #210
Closed

banner instead of comment? #205

dezren39 opened this issue Jan 1, 2024 · 1 comment · Fixed by #210
Assignees
Labels
enhancement New feature or request

Comments

@dezren39
Copy link
Contributor

dezren39 commented Jan 1, 2024

is it possible to make a banner middleware? i'm just gonna have my tea middleware output a banner instead but i had tried to figure out a way to make a generic middleware that is basically comment but at the beginning, couldn't figure it out! kind of feels like it would need to be a (ssh.Option) wish.WithBanner(string) function like outside middleware so the server can just output first. basically for showing a motd and standard banner about terms of service type stuff. later i'll probably build a fancier manual auth for users where they, idk, hit 'Y' or 'Enter' to accept or Ctrl+c to decline, but i'd like to have an easy way to throw a generic header for simpler cases or maybe when user is recognized as already having accepted.

caarlos0 added a commit to charmbracelet/ssh that referenced this issue Jan 4, 2024
caarlos0 added a commit to charmbracelet/ssh that referenced this issue Jan 4, 2024
caarlos0 added a commit that referenced this issue Jan 4, 2024
closes #205
needs charmbracelet/ssh#10

Signed-off-by: Carlos Alexandro Becker <[email protected]>
@caarlos0
Copy link
Member

caarlos0 commented Jan 4, 2024

hey, I opened the needed PRs to add this functionality.

thanks for the issue 🙏

see #210

@caarlos0 caarlos0 added the enhancement New feature or request label Jan 4, 2024
@caarlos0 caarlos0 self-assigned this Jan 4, 2024
caarlos0 added a commit that referenced this issue Jan 4, 2024
* feat: support server banners

closes #205
needs charmbracelet/ssh#10

Signed-off-by: Carlos Alexandro Becker <[email protected]>

* test: banner

Signed-off-by: Carlos Alexandro Becker <[email protected]>

* chore: dep

Signed-off-by: Carlos Alexandro Becker <[email protected]>

* feat: banner handler

Signed-off-by: Carlos Alexandro Becker <[email protected]>

* go mod tidy

Signed-off-by: Carlos Alexandro Becker <[email protected]>

* fix: improve example

Signed-off-by: Carlos Alexandro Becker <[email protected]>

---------

Signed-off-by: Carlos Alexandro Becker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants