Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3rd party broker #5015

Open
wants to merge 171 commits into
base: main
Choose a base branch
from
Open

3rd party broker #5015

wants to merge 171 commits into from

Conversation

hardillb
Copy link
Contributor

@hardillb hardillb commented Jan 15, 2025

part of #4969

Description

Adds APIs for provisioning 3rd Party MQTT Broker credentials for a team

  • /api/v1/teams/:teamId/brokers
    • GET - returns list of 3rd party broker credentials (sanitized of 'sensitive' credential info)
    • POST - creates a new 3rd party broker credential object
  • /api/v1/teams/:teamId/brokers/:brokerId
    • GET/PUT/DELETE - operations on individual broker creds object
  • /api/v1/teams/:teamId/brokers/:brokerId/credentials
    • GET (only accessible via agent token to retrieve credentials for use)

:brokerId is the usual hashid of the broker object's id. However, we will use team as a special case brokerId when refering to the team broker - which will have some particular behaviour. Details on that still to be figured out.

Related Issue(s)

#4969

Tasks

Preview Give feedback
  1. hardillb
  2. 2 of 3
    cstns hardillb
  3. bug
    cstns
  4. knolleary

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 67.54808% with 135 lines in your changes missing coverage. Please review.

Project coverage is 78.27%. Comparing base (d5a6a96) to head (c0e119b).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
forge/ee/routes/teamBroker/3rdPartyBroker.js 68.33% 57 Missing ⚠️
forge/ee/routes/teamBroker/schema.js 14.00% 43 Missing ⚠️
forge/db/models/MQTTTopicSchema.js 84.00% 8 Missing ⚠️
forge/containers/wrapper.js 56.25% 7 Missing ⚠️
...igrations/20250109-01-EE-3rd-party-broker-creds.js 41.66% 7 Missing ⚠️
forge/db/models/BrokerCredentials.js 86.84% 5 Missing ⚠️
forge/containers/stub/index.js 60.00% 2 Missing ⚠️
forge/routes/auth/index.js 60.00% 2 Missing ⚠️
forge/db/controllers/AccessToken.js 85.71% 1 Missing ⚠️
...migrations/20250124-01-EE-add-mqtt-topic-schema.js 83.33% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5015      +/-   ##
==========================================
- Coverage   78.42%   78.27%   -0.15%     
==========================================
  Files         331      339       +8     
  Lines       15544    15907     +363     
  Branches     3593     3675      +82     
==========================================
+ Hits        12190    12451     +261     
- Misses       3354     3456     +102     
Flag Coverage Δ
backend 78.27% <67.54%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hardillb
Copy link
Contributor Author

Team delete needs to also remove all 3rd party broker creds and shut down any mqtt-schema-agents that might be running.

container driver needs to look at DB on startup and restart any missing mqtt-schema-agents

@hardillb hardillb requested a review from knolleary January 21, 2025 16:39
@hardillb
Copy link
Contributor Author

Should be enough to start the UI work to create/edit these

@hardillb hardillb marked this pull request as ready for review January 21, 2025 16:40
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