Skip to content

Commit

Permalink
Fixed lint remarks and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
blaubaer committed Aug 26, 2024
1 parent ffffdfa commit 7fdb345
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 47 deletions.
25 changes: 10 additions & 15 deletions pkg/configuration/configuration_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
package configuration

import (
"testing"

"github.com/echocat/slf4g/sdk/testlog"

"github.com/engity-com/bifroest/pkg/common"
"github.com/engity-com/bifroest/pkg/crypto"
"github.com/engity-com/bifroest/pkg/template"
"testing"
)

func TestConfiguration_UnmarshalYAML(t *testing.T) {
Expand All @@ -33,14 +35,14 @@ func TestConfiguration_UnmarshalYAML(t *testing.T) {
name: "required-set",
yaml: `flows:
- name: foo
authorization:
authorization:
type: oidcDeviceAuth
issuer: https://foo-bar
clientId: anId
clientSecret: aSecret
environment:
type: local
name: foo`,
type: dummy
introduction: Foobar`,
expected: Configuration{
Ssh: Ssh{
Addresses: DefaultSshAddresses,
Expand Down Expand Up @@ -79,17 +81,10 @@ func TestConfiguration_UnmarshalYAML(t *testing.T) {
RetrieveIdToken: DefaultAuthorizationOidcRetrieveIdToken,
RetrieveUserInfo: DefaultAuthorizationOidcRetrieveUserInfo,
}},
Environment: Environment{&EnvironmentLocal{
User: UserRequirementTemplate{
Name: template.MustNewString("foo"),
Shell: DefaultUserRequirementShell,
},
LoginAllowed: DefaultEnvironmentLocalLoginAllowed,
CreateIfAbsent: DefaultEnvironmentLocalCreateIfAbsent,
UpdateIfDifferent: DefaultEnvironmentLocalUpdateIfDifferent,
Dispose: EnvironmentLocalDispose{},
Banner: DefaultEnvironmentLocalBanner,
PortForwardingAllowed: DefaultEnvironmentLocalPortForwardingAllowed,
Environment: Environment{&EnvironmentDummy{
LoginAllowed: DefaultEnvironmentDummyLoginAllowed,
Introduction: template.MustNewString("Foobar"),
IntroductionStyled: DefaultEnvironmentDummyIntroductionStyled,
}},
}},
HouseKeeping: HouseKeeping{
Expand Down
23 changes: 0 additions & 23 deletions pkg/dummy/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,26 +294,3 @@ func (this *Dummy) createPlayground() (tview.Primitive, func()) {

return instance, instance.reset
}

func (this *Dummy) evaluateButtons(e *tcell.EventMouse) []string {
var mbs []string
m := func(match tcell.ButtonMask, name string) {
if e.Buttons()&match != 0 {
mbs = append(mbs, name)
}
}
m(tcell.Button1, "Button1")
m(tcell.Button2, "Button2")
m(tcell.Button3, "Button3")
m(tcell.Button4, "Button4")
m(tcell.Button5, "Button5")
m(tcell.Button6, "Button6")
m(tcell.Button7, "Button7")
m(tcell.Button8, "Button8")
m(tcell.WheelUp, "WheelUp")
m(tcell.WheelDown, "WheelDown")
m(tcell.WheelLeft, "WheelLeft")
m(tcell.WheelRight, "WheelRight")

return mbs
}
9 changes: 0 additions & 9 deletions pkg/environment/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ func (this *dummy) Banner(Request) (io.ReadCloser, error) {
return io.NopCloser(bytes.NewReader(nil)), nil
}

func (this *dummy) introduction(req Request) (string, error) {
b, err := this.repository.conf.Introduction.Render(req)
if err != nil {
return "", err
}

return b, nil
}

func (this *dummy) Run(t Task) (exitCode int, rErr error) {
switch t.TaskType() {
case TaskTypeShell:
Expand Down
2 changes: 2 additions & 0 deletions pkg/user/ensure.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build unix

package user

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/user/repository.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build unix

package user

import (
Expand Down

0 comments on commit 7fdb345

Please sign in to comment.