Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 4c076a8

Browse files
author
Janos Bonic
committed
Fixes OpenAPI generation
1 parent 2bdaf03 commit 4c076a8

232 files changed

Lines changed: 1548 additions & 943 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

agentprotocol/NewForwardCtx.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ package agentprotocol
33
import (
44
"io"
55

6-
log "go.containerssh.io/libcontainerssh/log"
6+
log "go.containerssh.io/libcontainerssh/log"
77
)
88

99
func NewForwardCtx(fromBackend io.Reader, toBackend io.Writer, logger log.Logger) *ForwardCtx {
1010
return &ForwardCtx{
1111
fromBackend: fromBackend,
12-
toBackend: toBackend,
13-
logger: logger,
12+
toBackend: toBackend,
13+
logger: logger,
1414
}
15-
}
15+
}

agentprotocol/Protocol.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package agentprotocol
22

33
const (
4-
CONNECTION_TYPE_X11 = iota
5-
CONNECTION_TYPE_PORT_FORWARD = iota
6-
CONNECTION_TYPE_PORT_DIAL = iota
4+
CONNECTION_TYPE_X11 = iota
5+
CONNECTION_TYPE_PORT_FORWARD = iota
6+
CONNECTION_TYPE_PORT_DIAL = iota
77
CONNECTION_TYPE_SOCKET_FORWARD = iota
8-
CONNECTION_TYPE_SOCKET_DIAL = iota
8+
CONNECTION_TYPE_SOCKET_DIAL = iota
99
)
1010

1111
const (
12-
PROTOCOL_TCP string = "tcp"
12+
PROTOCOL_TCP string = "tcp"
1313
PROTOCOL_UNIX string = "unix"
1414
)
1515

@@ -24,10 +24,10 @@ const (
2424
)
2525

2626
type SetupPacket struct {
27-
ConnectionType uint32
28-
BindHost string
29-
BindPort uint32
30-
Protocol string
27+
ConnectionType uint32
28+
BindHost string
29+
BindPort uint32
30+
Protocol string
3131

3232
Screen string
3333
SingleConnection bool
@@ -36,16 +36,16 @@ type SetupPacket struct {
3636
}
3737

3838
type NewConnectionPayload struct {
39-
Protocol string
40-
39+
Protocol string
40+
4141
ConnectedAddress string
4242
ConnectedPort uint32
4343
OriginatorAddress string
4444
OriginatorPort uint32
4545
}
4646

4747
type Packet struct {
48-
Type int
48+
Type int
4949
ConnectionId uint64
50-
Payload []byte
50+
Payload []byte
5151
}

agentprotocol/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"sync"
77
"time"
88

9-
log "go.containerssh.io/libcontainerssh/log"
10-
message "go.containerssh.io/libcontainerssh/message"
119
"github.com/fxamacker/cbor/v2"
10+
log "go.containerssh.io/libcontainerssh/log"
11+
message "go.containerssh.io/libcontainerssh/message"
1212
)
1313

1414
const (

agentprotocol/server_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"io"
66
"testing"
77

8-
proto "go.containerssh.io/libcontainerssh/agentprotocol"
8+
proto "go.containerssh.io/libcontainerssh/agentprotocol"
99

10-
log "go.containerssh.io/libcontainerssh/log"
10+
log "go.containerssh.io/libcontainerssh/log"
1111
)
1212

1313
// region Tests

auditlog/codec/Decoder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package codec
22

33
import (
4-
internalCodec "go.containerssh.io/libcontainerssh/internal/auditlog/codec"
4+
internalCodec "go.containerssh.io/libcontainerssh/internal/auditlog/codec"
55
)
66

77
// Decoder is a module that is resonsible for decoding a binary testdata stream into audit log messages.

auditlog/message/channelrequest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (p PayloadChannelRequestPty) Equals(other Payload) bool {
100100
}
101101

102102
type PayloadChannelRequestX11 struct {
103-
RequestID uint64 `json:"requestId" yaml:"requestId"`
103+
RequestID uint64 `json:"requestId" yaml:"requestId"`
104104

105105
SingleConnection bool `json:"singleConnection" yaml:"singleConnection"`
106106
AuthProtocol string `json:"authProtocol" yaml:"authProtocol"`

auditlog/message/globalrequest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ func (p PayloadGlobalRequestDecodeFailed) Equals(other Payload) bool {
2929
return false
3030
}
3131
return p.RequestID == p2.RequestID && p.RequestType == p2.RequestType && p.Reason == p2.Reason
32-
}
32+
}

auditlog/storage/factory.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package storage
22

33
import (
4-
"go.containerssh.io/libcontainerssh/config"
5-
"go.containerssh.io/libcontainerssh/internal/auditlog"
6-
"go.containerssh.io/libcontainerssh/log"
7-
"go.containerssh.io/libcontainerssh/message"
4+
"go.containerssh.io/libcontainerssh/config"
5+
"go.containerssh.io/libcontainerssh/internal/auditlog"
6+
"go.containerssh.io/libcontainerssh/log"
7+
"go.containerssh.io/libcontainerssh/message"
88
)
99

1010
func New(cfg config.AuditLogConfig, logger log.Logger) (Storage, error) {

auditlog/storage/storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package storage
22

33
import (
4-
"go.containerssh.io/libcontainerssh/internal/auditlog/storage"
4+
"go.containerssh.io/libcontainerssh/internal/auditlog/storage"
55
)
66

77
type Storage interface {

auth/protocol.go

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
package auth
22

33
import (
4-
"go.containerssh.io/libcontainerssh/metadata"
4+
"go.containerssh.io/libcontainerssh/metadata"
55
)
66

77
// PasswordAuthRequest is an authentication request for password authentication.
88
//
99
// swagger:model PasswordAuthRequest
1010
type PasswordAuthRequest struct {
11+
// swagger:allOf
1112
metadata.ConnectionAuthPendingMetadata `json:",inline"`
1213

1314
// Password the user provided for authentication.
1415
//
1516
// required: true
17+
// in: body
1618
// swagger:strfmt Base64
1719
Password string `json:"passwordBase64"`
1820
}
@@ -21,8 +23,11 @@ type PasswordAuthRequest struct {
2123
//
2224
// swagger:model PublicKeyAuthRequest
2325
type PublicKeyAuthRequest struct {
26+
// swagger:allOf
2427
metadata.ConnectionAuthPendingMetadata `json:",inline"`
2528

29+
// in: body
30+
// required: true
2631
PublicKey `json:",inline"`
2732
}
2833

@@ -32,14 +37,24 @@ type PublicKeyAuthRequest struct {
3237
//
3338
// swagger:model AuthorizationRequest
3439
type AuthorizationRequest struct {
40+
// swagger:allOf
3541
metadata.ConnectionAuthenticatedMetadata `json:",inline"`
3642
}
3743

3844
// ResponseBody is a response to authentication requests.
3945
//
4046
// swagger:model AuthResponseBody
4147
type ResponseBody struct {
42-
metadata.ConnectionAuthenticatedMetadata `json:",inline"`
48+
metadata.DynamicMetadata `json:",inline"`
49+
50+
// AuthenticatedUsername contains the username that was actually verified. This may differ from LoginUsername when,
51+
// for example OAuth2 or Kerberos authentication is used. This field is empty until the authentication phase is
52+
// completed.
53+
//
54+
// required: false
55+
// in: body
56+
// example: systemusername
57+
AuthenticatedUsername string `json:"authenticatedUsername,omitempty"`
4358

4459
// Success indicates if the authentication was successful.
4560
//
@@ -55,5 +70,6 @@ type Response struct {
5570
// The response body
5671
//
5772
// in: body
58-
ResponseBody
73+
// required: true
74+
Body ResponseBody
5975
}

0 commit comments

Comments
 (0)