Skip to content

dcs: Pass gateway identifiers to claimer interface#7916

Open
vlasebian wants to merge 1 commit into
v3.36from
fix/missing-gateway-id-on-ttgc-claim
Open

dcs: Pass gateway identifiers to claimer interface#7916
vlasebian wants to merge 1 commit into
v3.36from
fix/missing-gateway-id-on-ttgc-claim

Conversation

@vlasebian
Copy link
Copy Markdown
Contributor

@vlasebian vlasebian commented May 19, 2026

Summary

The TTGC claimer previously only received the gateway EUI and reconstructed the id internally, dropping the gateway ID. Without this ID, the API keys cannot be created

Changes

  • Update the gateways.Claimer interface so Claim and Unclaim accept *ttnpb.GatewayIdentifiers instead of types.EUI64.
  • Default the gateway ID to the lower-cased EUI when the client does not supply TargetGatewayId
  • Shorten the LBS CUPS/LNS API key names generated by the TTGC claimer.
  • Added more tests

Testing

Steps

Unit test:

  1. Run go test ./pkg/deviceclaimingserver/....

e2e test:

  1. Insert a gateway in the staging TTGC database with the ec:65:6e:ff:fe prefix and 0x1000 capabilities.
  2. Claim it on staging1
Results

Unit tests pass locally and e2e testing shows claiming and configuring the gateway successfully.

Regressions
  • Gateway claim/unclaim flow via the Device Claiming Server, in particular the TTGC LBS CUPS and TTI v1 paths.
  • Cleanup behaviour when a claim fails after the gateway has been created in the Identity Server.

Notes for Reviewers

The signature change to the Claimer interface is an internal API; there is a single TTGC implementation. The EUI is still required and is now derived from the identifiers inside the claimer using types.MustEUI64(ids.Eui).OrZero().

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • Documentation: Relevant documentation is added or updated.
  • Testing: The steps/process to test this feature are clearly explained including testing for regressions.
  • Infrastructure: If infrastructural changes (e.g., new RPC, configuration) are needed, a separate issue is created in the infrastructural repositories.
  • Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

@vlasebian vlasebian self-assigned this May 19, 2026
@vlasebian vlasebian marked this pull request as ready for review May 19, 2026 13:59
@vlasebian vlasebian requested a review from a team as a code owner May 19, 2026 13:59
@vlasebian vlasebian requested a review from Copilot May 19, 2026 14:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Device Claiming Server’s gateway-claiming flow to preserve and forward full gateway identifiers (EUI + Gateway ID) into the TTGC claimer, enabling downstream operations (notably API key creation) that require the gateway ID.

Changes:

  • Update gateways.Claimer to accept *ttnpb.GatewayIdentifiers for Claim/Unclaim instead of types.EUI64.
  • Default TargetGatewayId to the lower-cased EUI hex string when the client does not provide one.
  • Adjust TTGC LBS CUPS/LNS API key naming and extend unit test coverage for identifier forwarding/defaulting.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/deviceclaimingserver/util_test.go Updates gateway-claimer mock to match the new GatewayIdentifiers-based interface.
pkg/deviceclaimingserver/grpc_gateways.go Builds/propagates GatewayIdentifiers (including default gateway ID) into upstream claiming/unclaiming.
pkg/deviceclaimingserver/grpc_gateways_test.go Adds/updates tests to validate identifier forwarding and default gateway ID behavior.
pkg/deviceclaimingserver/gateways/ttgc/ttiv1.go Updates TTGC TTI v1 claim handler to accept gateway identifiers and derive EUI from them.
pkg/deviceclaimingserver/gateways/ttgc/ttgc.go Updates TTGC claimer interface to accept identifiers and forwards them to protocol-specific handlers.
pkg/deviceclaimingserver/gateways/ttgc/lbscups.go Uses full identifiers for API key creation and shortens TTGC-generated key names.
pkg/deviceclaimingserver/gateways/gateways.go Changes the gateways.Claimer interface method signatures to take *ttnpb.GatewayIdentifiers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants