breadboard
breadboard copied to clipboard
When invalid key entered, don't add the provider
Currently, we add the provider even if the key is invalid. It's okay, since the ACLs still work correctly and access is read-only. But it would be nice to have a better message about read-only access.
Thanks @Mearman for finding.
Maybe something like "Optional: skip if you only want read-only access" next to the key
being able to select read or write would be nice for the sharing of board server instances
I wonder if we need a /validate or /acl endpoint to fetch with both URL & key so we can report it back?
yup
So, now there's an /info API endpoint on a board server. It returns data shaped like this:
export type ServerCapabilityAccess = "open" | "key";
export type ServerCapabilityInfo = {
path: string;
read: ServerCapabilityAccess;
write: ServerCapabilityAccess;
};
export type ServerCapability = "boards" | "proxy";
export type ServerInfo = {
title?: string;
description?: string;
capabilities?: Partial<Record<ServerCapability, ServerCapabilityInfo>>;
};
For example:
{
"title": "Breadboard Live!",
"capabilities": {
"boards": {
"read": "open",
"write": "key",
"path": "/boards"
},
"proxy": {
"path": "/proxy"
}
},
"description": "A server hosted by Dimitri Glazkov to let his friends and colleagues collaborate and build cool boards."
}
@timswanson-google who is looking into this
One additional note on the UX. Currently if you successfully add the board with the invalid key, and then attempt to create a board, there's no indication in the UI of what happened. The call to /boards on the board server returns a 400, and the UI doesn't do anything.