Skip to content

Latest commit

 

History

History
98 lines (79 loc) · 4.1 KB

File metadata and controls

98 lines (79 loc) · 4.1 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[0.2.0] - 2026-04-07

Added

New Features

  • rest.Decode() helper for typed response unmarshaling — eliminates manual JSON re-encode/decode pattern
  • Login timeout for API Protocol — prevents hanging on unresponsive routers when WithTimeout is set

TLS/SSL Documentation

  • Complete TLS/SSL certificate setup guide (docs/TLS_SETUP.md) — CA generation, server cert, service assignment
  • Go code examples for TLS connections (API Protocol and REST API)
  • Security best practices: IP restriction, disabling plaintext services, CA export for client trust
  • ECDSA certificate alternative for RouterOS v7

Documentation

  • Split README from 868 to 231 lines — detailed docs moved to docs/ directory
  • docs/REST_API.md — full REST API reference
  • docs/API_PROTOCOL.md — full API Protocol reference
  • docs/TLS_SETUP.md — RouterOS certificate setup guide
  • docs/MIGRATION.md — migration guide from routerosv7-restfull-api
  • Comprehensive inline code comments on all 14 source files (English US)
  • Updated CONTRIBUTING.md with integration testing section
  • Updated SECURITY.md with TLS best practices

Integration Testing

  • Verified all examples against real RouterOS devices:
    • RouterOS 7.15 (stable) — CHR x86_64: API, API-SSL, REST HTTP, REST HTTPS
    • RouterOS 6.49.19 (long-term) — x86: API, API-SSL
  • Confirmed identical output format between v6 and v7

CI/CD

  • Codecov integration with dynamic coverage badge
  • golangci-lint v2 job in CI pipeline
  • 100% coverage enforcement (fails CI if below 100%)
  • Go 1.24 added to test matrix
  • Windows added to test matrix (ubuntu, macos, windows)
  • go mod verify dependency audit step

Fixed

  • REST client: handle HTTP 204 No Content on DELETE — RouterOS returns empty body on successful delete, which caused EOF error in decodeJSONBody
  • REST client: rename shouldRetryTlsErrorRequestshouldRetryTLSErrorRequest for idiomatic Go naming
  • API client: suppress errcheck warnings on SetDeadline and ReadSentence calls
  • proto/writer: suppress errcheck warnings on buffered write operations
  • golangci-lint: update config to v2 format

Changed

  • Bump actions/checkout from v4 to v6
  • Bump actions/setup-go from v5 to v6
  • Bump codecov/codecov-action from v5 to v6
  • Bump github.com/stretchr/testify from v1.8.4 to v1.11.1

[0.1.0] - 2026-04-07

Added

REST API Package (rest/)

  • Client with NewClient() and functional options (WithInsecureSkipVerify, WithTimeout, WithHTTPClient)
  • CRUD methods: Auth, Print, Add, Set, Remove, Run
  • Request options: WithProplist, WithQuery, WithFilter
  • Structured error type APIError with StatusCode, Message, Detail
  • Automatic HTTPS/HTTP protocol detection with TLS fallback
  • Context support for cancellation and timeouts

API Protocol Package (api/)

  • Client with Dial() and functional options (WithTLS, WithTLSConfig, WithTimeout)
  • CRUD methods: Auth, Print, Add, Set, Remove, Run
  • Request options: WithProplist, WithQuery
  • Structured error types: DeviceError (trap) and FatalError
  • Auto-detect authentication (pre/post-6.43 RouterOS)
  • MD5 challenge-response login for legacy RouterOS
  • Context deadline support for TCP operations
  • !empty reply handling (RouterOS 7.18+)

Wire Protocol (api/proto/)

  • Binary length-prefix encoding/decoding (1-5 byte variable length)
  • Sentence, Pair structs for structured data
  • Reader and Writer for wire format I/O
  • ParseWord for API word parsing

Documentation

  • Comprehensive README with both packages documented
  • Usage examples for REST and API Protocol
  • Godoc example functions for pkg.go.dev
  • Thread safety documentation

CI/CD

  • GitHub Actions workflow (Go 1.21/1.22/1.23, Ubuntu/macOS/Windows)
  • 100% test coverage across all packages
  • golangci-lint integration