diff --git a/docs/newFederation-json-format.md b/docs/newFederation-json-format.md new file mode 100644 index 00000000..c21d7a39 --- /dev/null +++ b/docs/newFederation-json-format.md @@ -0,0 +1,48 @@ +## JSON Format for New Federation + +```json +{ + "federation_relationships": [ + { + "trust_domain": "server.org", + "bundle_endpoint_url": "https://host.docker.internal:8440", + "https_spiffe": { + "endpoint_spiffe_id": "spiffe://server.org/spire/server" + }, + "trust_domain_bundle": { + "trust_domain": "server.org", + "x509_authorities": [ + { + "asn1": "MIID3TCCAsWg... (truncated)" + }, + { + "asn1": "MIID3TCCAsWg... (truncated)" + }, + { + "asn1": "MIID3TCCAsWg... (truncated)" + } + ], + "jwt_authorities": [ + { + "public_key": "MIIBIjANBgkqh... (truncated)", + "key_id": "hZinOYBqM3jGnq...", + "expires_at": 1734022841 + }, + { + "public_key": "MIIBIjANBgkqh... (truncated)", + "key_id": "3o0DnZN5clyzR...", + "expires_at": 1734113731 + }, + { + "public_key": "MIIBIjANBgkqh... (truncated)", + "key_id": "ngoXDgR1SWATM...", + "expires_at": 1734191531 + } + ], + "sequence_number": 18 + } + } + ] +} + +``` diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 06408485..4a51c881 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -8,6 +8,8 @@ import SelectServer from "./components/select-server"; import ClusterList from "./components/cluster-list"; import ClusterManagement from "./components/cluster-management"; import FederationList from "./components/federation-list"; +import TrustBundleCreate from "components/trustbundle-create"; +import FederationCreate from "components/federation-create"; import AgentList from "./components/agent-list"; import CreateJoinToken from "./components/agent-create-join-token"; import EntryList from "./components/entry-list"; @@ -38,6 +40,8 @@ function App() { + + diff --git a/frontend/src/components/entry-create-json.tsx b/frontend/src/components/entry-create-json.tsx index 56d64a5d..620c9554 100644 --- a/frontend/src/components/entry-create-json.tsx +++ b/frontend/src/components/entry-create-json.tsx @@ -164,6 +164,13 @@ class CreateEntryJson extends Component - {this.state.parseError && + {this.state.parseError && (
- Invalid JSON Format/ JSON File Empty. } + subtitle="Invalid JSON Format/ JSON File Empty." timeout={0} title="New Entry JSON Format Notification" />
- } + )} +
Choose your local file:


@@ -618,6 +627,17 @@ class CreateEntryJson extends Component { + this.setState({ + parseError: false, + isEntriesLoaded: false, + newEntriesIds: [], + uploadedEntries: [], + newEntriesLoaded: false, + entrySelected: false, + selectedEntryId: -1, + }); + }} />
{this.state.isEntriesLoaded && !this.state.parseError && @@ -656,239 +676,242 @@ class CreateEntryJson extends Component } -
- -
{JSON.stringify(this.state.uploadedEntries, null, ' ')}
-
-
-
- -
-
-
- Step 1. SELECT ENTRY - {this.state.newEntriesIds.map((entryId, index) => ( -
- {/* eslint-disable-next-line */} - {index === this.state.selectedEntryId && -
- { - this.setSelectedEntriesIds(index, index, undefined); - e.preventDefault(); - }} - > - {(index + 1).toString() + ". " + entryId.spiffeId} - -
- } - {index !== this.state.selectedEntryId && -
- { - this.setSelectedEntriesIds(index, index, undefined); - e.preventDefault(); - }} - > - {(index + 1).toString() + ". " + entryId.spiffeId} - -
- } -
- ))} -
-

- [Select Entry to Edit] -
-
-

Step 2. EDIT ENTRY

-
- {!this.state.entrySelected && -
- -
- } - {this.state.entrySelected && -
- -

e.g. select if no Parent ID provided

-
- } -
-
- {this.onChangeParentIdInput(e)}} - /> + +
+
+ +
{JSON.stringify(this.state.uploadedEntries, null, ' ')}
+
+
+
+ +
+
+
+ Step 1. SELECT ENTRY + {this.state.newEntriesIds.map((entryId, index) => ( +
+ {/* eslint-disable-next-line */} + {index === this.state.selectedEntryId && +
+ { + this.setSelectedEntriesIds(index, index, undefined); + e.preventDefault(); + }} + > + {(index + 1).toString() + ". " + entryId.spiffeId} + +
+ } + {index !== this.state.selectedEntryId && +
+ { + this.setSelectedEntriesIds(index, index, undefined); + e.preventDefault(); + }} + > + {(index + 1).toString() + ". " + entryId.spiffeId} + +
+ } +
+ ))} +
+

+ [Select Entry to Edit]
-
- { - const input = e.target.value - e.target.value = this.state.spiffeIdPrefix + input.substr(this.state.spiffeIdPrefix.length); - this.onChangeSpiffeId(e); - }} +
+

Step 2. EDIT ENTRY

+
+ {!this.state.entrySelected && +
+ +
+ } + {this.state.entrySelected && +
+ +

e.g. select if no Parent ID provided

+
+ } +
+
+ {this.onChangeParentIdInput(e)}} + /> +
+
+ { + const input = e.target.value + e.target.value = this.state.spiffeIdPrefix + input.substr(this.state.spiffeIdPrefix.length); + this.onChangeSpiffeId(e); + }} + /> +
+