Skip to content

WIP: Changes to get a demo going#32

Closed
doanac wants to merge 52 commits into
mainfrom
demo
Closed

WIP: Changes to get a demo going#32
doanac wants to merge 52 commits into
mainfrom
demo

Conversation

@doanac

@doanac doanac commented Aug 5, 2025

Copy link
Copy Markdown
Member

No description provided.

doanac and others added 30 commits June 18, 2025 13:04
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Get basic linting tests in place
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Add come certificate helpers
This is the same latest we use in fioctl - easier dev process

Signed-off-by: Volodymyr Khoroz <volodymyr.khoroz@foundries.io>
Signed-off-by: Volodymyr Khoroz <volodymyr.khoroz@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Volodymyr Khoroz <volodymyr.khoroz@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Volodymyr Khoroz <volodymyr.khoroz@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Volodymyr Khoroz <volodymyr.khoroz@foundries.io>
This allows us to store bigger files like hardware-info and such outside
of the database.

Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Volodymyr Khoroz <volodymyr.khoroz@foundries.io>
This was spotted by QGenie

Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Volodymyr Khoroz <volodymyr.khoroz@foundries.io>
An idea is to pass log inside context to all underlying functions.
Log context is initialized at the top-most application level.
Common context package is separated to allow access to it from other packages.
Third-party packages which do not support slog will be directed to it via a configured bridge.

Signed-off-by: Volodymyr Khoroz <volodymyr.khoroz@foundries.io>
Signed-off-by: Volodymyr Khoroz <volodymyr.khoroz@foundries.io>
Signed-off-by: Volodymyr Khoroz <volodymyr.khoroz@foundries.io>
server: skeleton for api and gateway servers
This works in unit tests somehow but was failing under `go run ...`

Signed-off-by: Andy Doan <andy@foundries.io>
This change fixes a couple of problems:

 * The ApiAddress and GatewayAddress struct members were showing up as
   CLI arguments the user could set. eg: `server --apiaddress=localhost`

 * `go run ... serve` was failing because it didn't call the `NewServer`
   function.

All of that was tied to the test code needing to wait for the server to
start. This change introduces a single, optional callback function that
can be used by server_test.go to know when the server is ready.

Signed-off-by: Andy Doan <andy@foundries.io>
This code introduces a way to define new REST API handlers and test
them. Rather than spin up entire HTTP servers like we've done in the
past, I'm leaning more on the httptest module to make this easier and
faster.

Signed-off-by: Andy Doan <andy@foundries.io>
This is very similar to the previous request. However, it also must set
an x509.Certificate in request created by httptest.NewRequest so that
our middleware can validate the device's certificate.

Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
doanac added 9 commits August 4, 2025 16:46
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
This follows the usual pattern of our projects and makes it easy to
launch a shell where you can develop from with all the necessary
dependencies in place.

Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Add contrib directory for local development helpers
This can be pretty helpful when debugging why your devices can't
communicate with a server

Signed-off-by: Andy Doan <andy@foundries.io>
@doanac doanac force-pushed the demo branch 6 times, most recently from 0a3d64b to 7216879 Compare August 5, 2025 13:13
doanac added 11 commits August 5, 2025 09:35
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Volodymyr Khoroz <volodymyr.khoroz@foundries.io>
The callers of these APIs get their content as bytes so this removes
some extraneous marshalling logic. Furthermore, we have code in the
future that needs to save binary content from an io stream.

Signed-off-by: Andy Doan <andy@foundries.io>
We have code in fiotest logic that needs to be able to get the raw byte
stream.

Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
This module is mostly place holder for future user management in this
product. For now, we fake out a user.

Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
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.

2 participants