Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 1 addition & 36 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -230,39 +230,4 @@ Copyright (c) 2026, RtBrick

=== SPDX Identifier

`BSD-3-Clause`




rtb-buddy lix1 generate ca --cn rtbrick-lab --org rtbrick --ou devops
rtb-buddy lix1 generate ca --cn rtbrick-lab --org rtbrick --ou devops --ca-crt client-ca.crt --ca-crt-key client-ca.key

rtb-buddy lix1 generate cert --cn ufi31 --org rtbrick --ou devops --crt ufi31.crt --crt-key ufi31.key

rtb-buddy lix1 generate cert --cn client1 --org rtbrick --ou devops --ca-crt client-ca.crt --ca-crt-key client-ca.key --crt client1.crt --crt-key client1.key


set lawful-intercept protocol x1 mutual-tls server certificate LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVjVENDQTFtZ0F3SUJBZ0lDQm5vd0RRWUpLb1pJaHZjT...
set lawful-intercept protocol x1 mutual-tls server key-plain-text LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktL...
set lawful-intercept protocol x1 mutual-tls client root-ca LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURYakNDQWthZ0F3SUJBZ0lSQVBtUjVoRWxtZ0NOaVliWVZ
jZXV6Yll3RFFZSktvWklodmNOQVFFTEJRQXcKT1RFUU1BNEdBMVVFQ2hNSGNuUmljbWxqYXpFUE1BMEdBMVVFQ3hNR1pHVjJiM0J6TV
JRd0VnWURWUVFERXd0eQpkR0p5YVdOckxXeGhZakFlRncweU5qRXdNVFF4TUR

[source,sh]
----
curl --insecure -vvv --key client1.key --cert client1.crt --cacert ca.crt --location 'https://ufi31.q2a.u39.r3.nbg.rtbrick.net:12322/X1/NE' \
--header 'Content-Type: application/json' \
--data '<X1Request xmlns="http://uri.etsi.org/03221/X1/2017/10">
<x1RequestMessage xsi:type="PingRequest">
<admfIdentifier>ADMF-ID-01</admfIdentifier>
<neIdentifier>NE-ID-102</neIdentifier>
<messageTimestamp>2026-09-22T20:51:00Z</messageTimestamp>
<version>v1.12.1</version>
<x1TransactionId>f81d4fae-7dec-11d0-a765-00a0c91e6bf6</x1TransactionId>
</x1RequestMessage>
</X1Request>'
----


2026/10/14 10:36:23 INFO Programm info version=0.4.0-g6daily.20261013144632+Bdevelopment.C53e4a3f0 runtime=go1.27.1
`BSD-3-Clause`
3 changes: 3 additions & 0 deletions cmd/rtb-buddy/cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package cmd

import (
"os"

"github.com/rtbrick/tools/cmd/rtb-buddy/config"
"github.com/rtbrick/tools/pkg/cmd/apigw"
"github.com/rtbrick/tools/pkg/cmd/lix1"
Expand All @@ -15,6 +17,7 @@ func NewRootCmd(silenceErrors, silenceUsage bool) *cobra.Command {
SilenceErrors: silenceErrors,
SilenceUsage: silenceUsage,
}
cmd.SetOut(os.Stdout)
cmd.Version = config.VERSION
cmd.AddCommand(apigw.NewApigwCmd())
cmd.AddCommand(lix1.NewLix1Cmd())
Expand Down
48 changes: 40 additions & 8 deletions cmd/rtb-buddy/rbfs_lix1.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
==== rbfs lix1d
==== rbfs lix1

Generates RBFS LI X1 mTLS CLI `set` commands from certificates.
Generates RBFS LI X1 mTLS CLI `set` commands from certificates and sends PingRequest.

===== rbfs lix1d server certificate
===== rbfs lix1 server certificate

Generates server certificate and key configuration commands.

Expand All @@ -11,7 +11,7 @@ Generates server certificate and key configuration commands.

[source,sh]
----
rtb-buddy rbfs lix1d server certificate --cert server.crt --cert-key server.key
rtb-buddy rbfs lix1 server certificate --cert server.crt --cert-key server.key
----

Outputs:
Expand All @@ -20,34 +20,66 @@ set lawful-intercept protocol x1 mutual-tls server certificate <base64>
set lawful-intercept protocol x1 mutual-tls server key-plain-text <base64>
```

===== rbfs lix1d server client-ca
===== rbfs lix1 server client-ca

Generates server client CA configuration command.

* `--cert` — Client CA certificate PEM file (required)

[source,sh]
----
rtb-buddy rbfs lix1d server client-ca --cert client-ca.crt
rtb-buddy rbfs lix1 server client-ca --cert client-ca.crt
----

Outputs:
```
set lawful-intercept protocol x1 mutual-tls server client-ca <base64>
```

===== rbfs lix1d client root-ca
===== rbfs lix1 client root-ca

Generates client root CA configuration command.

* `--cert` — Root CA certificate PEM file (required)

[source,sh]
----
rtb-buddy rbfs lix1d client root-ca --cert root-ca.crt
rtb-buddy rbfs lix1 client root-ca --cert root-ca.crt
----

Outputs:
```
set lawful-intercept protocol x1 mutual-tls client root-ca <base64>
```

===== rbfs lix1 ping

Send X1 PingRequest to RBFS router (LI X1 over mTLS).

* `--cert` — Client certificate PEM file (required)
* `--cert-key` — Client private key PEM file (required)
* `<path>` — Router hostname or address (required)

[source,sh]
----
rtb-buddy rbfs lix1 ping <path> --cert client1.crt --cert-key client1.key
----

Output:
```
Status: 200
Content-Type: application/xml
Response:
<?xml version="1.0" encoding="UTF-8"?>
<X1Request xmlns="http://uri.etsi.org/03221/X1/2017/10">
<x1RequestMessage xsi:type="PingRequest">
<admfIdentifier>ADMF-ID-01</admfIdentifier>
<neIdentifier>NE-ID-102</neIdentifier>
<messageTimestamp>2026-01-15T12:00:00Z</messageTimestamp>
<version>v1.12.1</version>
<x1TransactionId>f81d4fae-7dec-11d0-a765-00a0c91e6bf6</x1TransactionId>
<pingType>basic</pingType>
<requestedNumberOfRepetitions>1</requestedNumberOfRepetitions>
</x1RequestMessage>
</X1Request>
```
20 changes: 1 addition & 19 deletions pkg/cmd/apigw/apigw_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,26 +174,8 @@ func TestGenerateTokenCmd(t *testing.T) {
},
{
name: "valid token without name",
args: []string{"token", "--priv-key", privPath, "--sub", "user1", "--preferred-username", "testuser"},
wantErr: false,
},
{
name: "missing sub",
args: []string{"token", "--priv-key", privPath, "--name", "Test User", "--preferred-username", "testuser"},
wantErr: true,
errMsg: "required flag(s) \"sub\" not set",
},
{
name: "missing preferred-username",
args: []string{"token", "--priv-key", privPath, "--sub", "user1", "--name", "Test User"},
wantErr: true,
errMsg: "required flag(s) \"preferred-username\" not set",
},
{
name: "missing all required",
args: []string{"token", "--priv-key", privPath},
wantErr: true,
errMsg: "required flag(s)",
wantErr: false,
},
{
name: "invalid priv path",
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/apigw/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

const (
flagCert = "cert"
flagCert = flags.FlagCert
flagKey = "key"
flagOrg = "org"
flagHost = "host"
Expand Down
3 changes: 0 additions & 3 deletions pkg/cmd/apigw/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ func newTokenCmd() *cobra.Command {
cmd.Flags().StringVar(&overrideKid, flagOverrideKid, "", "Override the kid in the JWT header")
cmd.Flags().DurationVar(&dur, flagDur, defaultDuration, "Token duration")

_ = cmd.MarkFlagRequired(flagSub)
_ = cmd.MarkFlagRequired(flagPreferredUser)

return cmd
}

Expand Down
4 changes: 3 additions & 1 deletion pkg/cmd/lix1/flags.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package lix1

import "time"
import (
"time"
)

const (
flagCACrt = "ca-crt"
Expand Down
7 changes: 5 additions & 2 deletions pkg/cmd/rbfs/lix1d.go → pkg/cmd/rbfs/lix1.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"github.com/spf13/cobra"
)

func NewLix1dCmd() *cobra.Command {
func NewLix1Cmd() *cobra.Command {
cmd := &cobra.Command{
Use: "lix1d",
Use: "lix1",
Short: "Generate RBFS LI X1 mTLS CLI commands from certificates",
}

Expand All @@ -24,8 +24,11 @@ func NewLix1dCmd() *cobra.Command {
}
clientCmd.AddCommand(newClientRootCACmd())

pingCmd := NewLix1PingCmd()

cmd.AddCommand(serverCmd)
cmd.AddCommand(clientCmd)
cmd.AddCommand(pingCmd)
return cmd
}

Expand Down
Loading
Loading