1ed845bf2d
test(interaction): add unit tests for interaction behavior
2026-01-27 16:28:20 +07:00
67378aabda
refactor(dockerfile): split long ldflags line
2026-01-27 16:28:20 +07:00
a26d1672d9
refactor(interaction): reduce cognitive complexity and centralize color constants
2026-01-27 16:28:20 +07:00
7f44cc7bc0
fix: ensure proper buffer reuse with pointer handling in sync.Pool
2026-01-27 16:28:20 +07:00
a3f6baa6ae
test: check and handle error for testing
2026-01-27 16:28:20 +07:00
6def82a095
ci: add project source and test path for sonarqube
2026-01-27 16:28:20 +07:00
354da27424
test(forwarder): add unit tests for forwarder behavior
2026-01-27 16:28:20 +07:00
ee1dc3c3cd
chore(tests): migrate to Testify for mocking and assertions
2026-01-27 16:28:20 +07:00
65df01fee5
refactor(forwarder): remove CreateForwardedTCPIPPayload method
...
- OpenForwardedChannel now privately calls CreateForwardedTCPIPPayload
- Removed an unused function
2026-01-27 16:28:20 +07:00
79fd292a77
feat(http): add http header size limit for initial request
2026-01-27 16:28:20 +07:00
4041681be6
refactor(header): NewRequest to accept only []byte
2026-01-27 16:28:20 +07:00
2ee24c8d51
test(config): add test for keyloc and header size
2026-01-27 16:28:20 +07:00
384bb98f48
test(stream): migrate mocking to testify
2026-01-27 16:28:20 +07:00
9785a97973
refactor: remove duplicate channel management helpers from HTTP handler
2026-01-27 16:28:20 +07:00
b8c6359820
refactor: remove custom parsing functions and use ssh.Marshal/ssh.Unmarshal for serialization
2026-01-27 16:28:20 +07:00
8fee8bf92e
test(server): add unit test for handleConnection
2026-01-27 16:28:20 +07:00
04c9ddbc13
test(lifecycle): add unit tests for lifecycle behavior
2026-01-27 16:28:20 +07:00
211745dc26
test(slug): add unit tests for slug behavior
2026-01-27 16:28:20 +07:00
09aa92a0ae
fix: properly initialize tlsStoragePath in config load
2026-01-27 16:28:20 +07:00
1ed9f3631f
fix: correct buffer pool usage to avoid type assertion error
2026-01-27 16:28:20 +07:00
bd826d6d06
refactor(transport): reduce cognitive complexity and clean up public API
2026-01-27 16:28:20 +07:00
2f5c44ff01
test(bootstrap): add unit tests for initial bootstrap behavior
2026-01-27 16:28:20 +07:00
d0e052524c
refactor: decouple application startup logic from main
2026-01-27 16:28:20 +07:00
24b9872aa4
fix: corrected defer usage to pass buffer pointer
2026-01-27 16:28:20 +07:00
8b84373036
fix: remove unnecessary use of fmt.Sprintf
2026-01-27 16:28:20 +07:00
e796ab5328
fix: handle error return values for privateKeyFile.Close and pubKeyFile.Close
2026-01-27 16:28:20 +07:00
efdfc4ce95
chore: remove unused headerBuf variable
2026-01-27 16:28:20 +07:00
1dc929cc25
ci: sonarqube add linting
2026-01-27 16:28:20 +07:00
14abac6579
test(session): add unit tests for session behavior
2026-01-27 16:28:20 +07:00
21179da4b5
refactor(session): reduce function parameters
2026-01-27 16:28:20 +07:00
32f8be2891
test(version): add unit tests for version behavior
2026-01-27 16:28:20 +07:00
5af7af3139
test(client): add unit tests for grpc client behavior
2026-01-27 16:28:20 +07:00
f4848e9754
fix(client): reduce cognitive complexity and fix typo (go:S3776)
2026-01-27 16:28:20 +07:00
d2e508c8ef
test(key): add unit tests for key behavior
2026-01-27 16:28:20 +07:00
5499b7d08a
ci: update SonarQube action configuration
2026-01-27 16:28:20 +07:00
58f1fdabe1
test(server): add unit tests for server startup behavior
2026-01-27 16:28:20 +07:00
c1fb588cf4
test(config): add unit tests for config behavior
2026-01-27 16:28:20 +07:00
3029996773
test(stream): add unit tests for stream behavior
...
- Fix duplicating EOF error when closing SSH connection
- Add new SessionStatusCLOSED type
2026-01-27 16:28:20 +07:00
3fd179d32b
test(header): add unit tests for header behavior
2026-01-27 16:28:20 +07:00
a598a10e94
update: exclude local test coverage
2026-01-27 16:28:20 +07:00
29cabe42d3
test(transport): add unit tests for transport behavior using Testify
2026-01-27 16:28:20 +07:00
e534972abc
test(random): add unit tests for random behavior
...
- Added unit tests to cover random string generation and error handling.
- Introduced Random interface and random struct for better abstraction.
- Updated server, session, and interaction packages to require Random interface for dependency injection.
2026-01-27 16:28:20 +07:00
a55ff5f6ab
test(port): add unit tests for port behavior
2026-01-27 16:28:20 +07:00
50b4127cb3
test(middleware): add unit tests for middleware behavior
...
- remove redundant check on registry.Update and check if slug exist before locking the mutex
- Update SonarQube action to not use Go cache when setting up Go
2026-01-27 16:28:20 +07:00
7e635721fb
ci: automate Go tests and Sonar coverage reporting
2026-01-27 16:28:20 +07:00
016df9caee
test(registry): add unit tests for registry behavior
2026-01-27 16:28:20 +07:00
961a905542
chore(restructure): refactor architecture, config, and lifecycle management
...
Docker Build and Push / build-and-push-tags (push) Has been skipped
SonarQube Scan / SonarQube Trigger (push) Successful in 44s
Docker Build and Push / build-and-push-branches (push) Successful in 11m16s
SonarQube Scan / SonarQube Trigger (pull_request) Successful in 46s
- Reorganized internal packages and overall project structure
- Moved HTTP/HTTPS/TCP servers into the transport layer
- Decoupled server initialization from HTTP/HTTPS/TCP startup logic
- Separated HTTP parsing, streaming, middleware, and session registry concerns
- Refactored session and forwarder responsibilities for clearer ownership
- Centralized environment loading with validated, typed config access
- Made config immutable after initialization and normalized enum naming
- Improved resource lifecycle handling and error aggregation on shutdown
- Introduced reusable, package-level registry errors
- Added SonarQube scanning to CI pipeline
Reviewed-on: #73
2026-01-22 00:48:40 +07:00
634c8321ef
refactor(registry): define reusable constant errors
...
SonarQube Scan / SonarQube Trigger (push) Successful in 52s
SonarQube Scan / SonarQube Trigger (pull_request) Successful in 46s
- Introduced package-level error variables in registry to replace repeated fmt.Errorf calls
- Added errors like ErrSessionNotFound, ErrSlugInUse, ErrInvalidSlug, ErrForbiddenSlug, ErrSlugChangeNotAllowed, and ErrSlugUnchanged
2026-01-22 00:39:28 +07:00
9f4c24a3f3
refactor(lifecycle): reorder resource closing and simplify Close()
...
SonarQube Scan / SonarQube Trigger (push) Successful in 53s
- Close channel and connection first, then remove session
- Close forwarded port and forwarder at the end for TCP tunnels
- Aggregate all errors using errors.Join instead of failing early
2026-01-21 21:59:59 +07:00
1408b80917
ci: add sonarqube scan
SonarQube Scan / SonarQube Trigger (push) Successful in 48s
2026-01-21 21:24:57 +07:00