diff --git a/config/commands.yaml b/config/commands.yaml index 39f06a4..2911801 100644 --- a/config/commands.yaml +++ b/config/commands.yaml @@ -81,8 +81,7 @@ groups: - name: site description: | Display help for site commands and exit. - - @resource_description@ + inherit_standard_options: [help] - name: site create description: | Create a site. @@ -173,6 +172,8 @@ groups: commands: - name: token resource: Claim + related_concepts: ["access grant", "access token"] + related_resources: [Grant, Claim] description: | Display help for token commands and exit. inherit_standard_options: [help] @@ -237,8 +238,6 @@ groups: related_commands: [token] description: | Display help for link commands and exit. - - @resource_description@ inherit_standard_options: [help] - name: link create description: | @@ -292,6 +291,7 @@ groups: - name: Service exposure commands: - name: connector + related_commands: [listener] description: | Display help for connector commands and exit. inherit_standard_options: [help] @@ -405,6 +405,7 @@ groups: database database app=postgresql - 5432 1 inherit_standard_options: [output, namespace, context, platform, help] - name: listener + related_commands: [connector] description: | Display help for listener commands and exit. inherit_standard_options: [help] diff --git a/config/concepts.yaml b/config/concepts.yaml index a2b9c5d..83520da 100644 --- a/config/concepts.yaml +++ b/config/concepts.yaml @@ -46,8 +46,7 @@ groups: - XXX link cost - XXX only one direction needed - name: link access - - name: grant - rename: Access grant + - name: access grant links: - name: Access token concept url: /concepts/claim.html @@ -59,8 +58,7 @@ groups: URL and secret code to obtain a certificate signed by the grant's certificate authority (CA), within a certain expiration window and for a limited number of redemptions. - - name: claim - rename: Access token + - name: access token links: - name: Access grant concept url: /concepts/grant.html diff --git a/input/commands/connector-create.md b/input/commands/connector-create.md index d80fd39..686c812 100644 --- a/input/commands/connector-create.md +++ b/input/commands/connector-create.md @@ -1,6 +1,12 @@ --- body_class: command links: + - name: Connector concept + url: /concepts/connector.html + - name: Connector resource + url: /resources/connector.html + - name: Connector command + url: /commands/connector.html - name: Listener create command url: /commands/listener-create.html --- diff --git a/input/commands/connector-delete.md b/input/commands/connector-delete.md index a7df3e3..4b8adcd 100644 --- a/input/commands/connector-delete.md +++ b/input/commands/connector-delete.md @@ -1,6 +1,12 @@ --- body_class: command links: + - name: Connector concept + url: /concepts/connector.html + - name: Connector resource + url: /resources/connector.html + - name: Connector command + url: /commands/connector.html - name: Listener delete command url: /commands/listener-delete.html --- diff --git a/input/commands/connector-status.md b/input/commands/connector-status.md index d4f7104..ffe9fe3 100644 --- a/input/commands/connector-status.md +++ b/input/commands/connector-status.md @@ -1,5 +1,12 @@ --- body_class: command +links: + - name: Connector concept + url: /concepts/connector.html + - name: Connector resource + url: /resources/connector.html + - name: Connector command + url: /commands/connector.html --- # Connector status command diff --git a/input/commands/connector-update.md b/input/commands/connector-update.md index 9f1bba9..c724143 100644 --- a/input/commands/connector-update.md +++ b/input/commands/connector-update.md @@ -1,6 +1,12 @@ --- body_class: command links: + - name: Connector concept + url: /concepts/connector.html + - name: Connector resource + url: /resources/connector.html + - name: Connector command + url: /commands/connector.html - name: Listener update command url: /commands/listener-update.html --- diff --git a/input/commands/connector.md b/input/commands/connector.md index c14fc06..acedfe9 100644 --- a/input/commands/connector.md +++ b/input/commands/connector.md @@ -5,6 +5,8 @@ links: url: /concepts/connector.html - name: Connector resource url: /resources/connector.html + - name: Listener command + url: /commands/listener.html --- # Connector command diff --git a/input/commands/debug-dump.md b/input/commands/debug-dump.md index dabd472..3ba5f3d 100644 --- a/input/commands/debug-dump.md +++ b/input/commands/debug-dump.md @@ -1,5 +1,8 @@ --- body_class: command +links: + - name: Debug command + url: /commands/debug.html --- # Debug dump command diff --git a/input/commands/link-create.md b/input/commands/link-create.md index dfab1c8..c9dc7d9 100644 --- a/input/commands/link-create.md +++ b/input/commands/link-create.md @@ -1,5 +1,12 @@ --- body_class: command +links: + - name: Link concept + url: /concepts/link.html + - name: Link resource + url: /resources/link.html + - name: Link command + url: /commands/link.html --- # Link create command diff --git a/input/commands/link-delete.md b/input/commands/link-delete.md index de2c262..5467549 100644 --- a/input/commands/link-delete.md +++ b/input/commands/link-delete.md @@ -1,5 +1,12 @@ --- body_class: command +links: + - name: Link concept + url: /concepts/link.html + - name: Link resource + url: /resources/link.html + - name: Link command + url: /commands/link.html --- # Link delete command diff --git a/input/commands/link-status.md b/input/commands/link-status.md index 70bf1d4..d2ae2ca 100644 --- a/input/commands/link-status.md +++ b/input/commands/link-status.md @@ -1,5 +1,12 @@ --- body_class: command +links: + - name: Link concept + url: /concepts/link.html + - name: Link resource + url: /resources/link.html + - name: Link command + url: /commands/link.html --- # Link status command diff --git a/input/commands/link-update.md b/input/commands/link-update.md index 8e6c63b..f9dd378 100644 --- a/input/commands/link-update.md +++ b/input/commands/link-update.md @@ -1,5 +1,12 @@ --- body_class: command +links: + - name: Link concept + url: /concepts/link.html + - name: Link resource + url: /resources/link.html + - name: Link command + url: /commands/link.html --- # Link update command diff --git a/input/commands/link.md b/input/commands/link.md index 29e12be..a8f220c 100644 --- a/input/commands/link.md +++ b/input/commands/link.md @@ -15,13 +15,6 @@ links: Display help for link commands and exit. -A site-to-site communication channel. Links serve as a -transport for application connections and requests. A set -of linked sites constitute a network. - -Links are not usually created directly. Instead, you -typically use an access token to obtain a link. -
diff --git a/input/commands/listener-create.md b/input/commands/listener-create.md index df60f01..7c5d249 100644 --- a/input/commands/listener-create.md +++ b/input/commands/listener-create.md @@ -1,6 +1,12 @@ --- body_class: command links: + - name: Listener concept + url: /concepts/listener.html + - name: Listener resource + url: /resources/listener.html + - name: Listener command + url: /commands/listener.html - name: Connector create command url: /commands/connector-create.html --- diff --git a/input/commands/listener-delete.md b/input/commands/listener-delete.md index 04849bb..9136634 100644 --- a/input/commands/listener-delete.md +++ b/input/commands/listener-delete.md @@ -1,6 +1,12 @@ --- body_class: command links: + - name: Listener concept + url: /concepts/listener.html + - name: Listener resource + url: /resources/listener.html + - name: Listener command + url: /commands/listener.html - name: Connector delete command url: /commands/connector-delete.html --- diff --git a/input/commands/listener-status.md b/input/commands/listener-status.md index 821f0eb..e477683 100644 --- a/input/commands/listener-status.md +++ b/input/commands/listener-status.md @@ -1,5 +1,12 @@ --- body_class: command +links: + - name: Listener concept + url: /concepts/listener.html + - name: Listener resource + url: /resources/listener.html + - name: Listener command + url: /commands/listener.html --- # Listener status command diff --git a/input/commands/listener-update.md b/input/commands/listener-update.md index a498527..e72e0f4 100644 --- a/input/commands/listener-update.md +++ b/input/commands/listener-update.md @@ -1,6 +1,12 @@ --- body_class: command links: + - name: Listener concept + url: /concepts/listener.html + - name: Listener resource + url: /resources/listener.html + - name: Listener command + url: /commands/listener.html - name: Connector update command url: /commands/connector-update.html --- diff --git a/input/commands/listener.md b/input/commands/listener.md index e2e765e..862091b 100644 --- a/input/commands/listener.md +++ b/input/commands/listener.md @@ -5,6 +5,8 @@ links: url: /concepts/listener.html - name: Listener resource url: /resources/listener.html + - name: Connector command + url: /commands/connector.html --- # Listener command diff --git a/input/commands/site-create.md b/input/commands/site-create.md index 9ac1d9e..b969303 100644 --- a/input/commands/site-create.md +++ b/input/commands/site-create.md @@ -1,5 +1,12 @@ --- body_class: command +links: + - name: Site concept + url: /concepts/site.html + - name: Site resource + url: /resources/site.html + - name: Site command + url: /commands/site.html --- # Site create command diff --git a/input/commands/site-delete.md b/input/commands/site-delete.md index 3fe4dad..2cc0479 100644 --- a/input/commands/site-delete.md +++ b/input/commands/site-delete.md @@ -1,5 +1,12 @@ --- body_class: command +links: + - name: Site concept + url: /concepts/site.html + - name: Site resource + url: /resources/site.html + - name: Site command + url: /commands/site.html --- # Site delete command diff --git a/input/commands/site-status.md b/input/commands/site-status.md index 5aab2fa..874b32b 100644 --- a/input/commands/site-status.md +++ b/input/commands/site-status.md @@ -1,5 +1,12 @@ --- body_class: command +links: + - name: Site concept + url: /concepts/site.html + - name: Site resource + url: /resources/site.html + - name: Site command + url: /commands/site.html --- # Site status command diff --git a/input/commands/site-update.md b/input/commands/site-update.md index 7452355..49c72c5 100644 --- a/input/commands/site-update.md +++ b/input/commands/site-update.md @@ -1,5 +1,12 @@ --- body_class: command +links: + - name: Site concept + url: /concepts/site.html + - name: Site resource + url: /resources/site.html + - name: Site command + url: /commands/site.html --- # Site update command diff --git a/input/commands/site.md b/input/commands/site.md index 79ebe18..80ee19a 100644 --- a/input/commands/site.md +++ b/input/commands/site.md @@ -13,9 +13,18 @@ links: Display help for site commands and exit. -A place where components of your application are running. -Sites are linked to form application networks. +
+ +
+ +## Options + +-

--help

-There can be only one site resource per namespace. + Display help and exit. + | | | + |-|-| + | Platforms | Kubernetes, Docker | +
diff --git a/input/commands/token-issue.md b/input/commands/token-issue.md index d210e49..7fbba3c 100644 --- a/input/commands/token-issue.md +++ b/input/commands/token-issue.md @@ -1,6 +1,8 @@ --- body_class: command links: + - name: Token command + url: /commands/token.html - name: Token redeem command url: /commands/token-redeem.html --- diff --git a/input/commands/token-redeem.md b/input/commands/token-redeem.md index 35db699..861972a 100644 --- a/input/commands/token-redeem.md +++ b/input/commands/token-redeem.md @@ -1,6 +1,8 @@ --- body_class: command links: + - name: Token command + url: /commands/token.html - name: Token issue command url: /commands/token-issue.html --- diff --git a/input/commands/token.md b/input/commands/token.md index 0189b30..b8e70b8 100644 --- a/input/commands/token.md +++ b/input/commands/token.md @@ -1,5 +1,14 @@ --- body_class: command +links: + - name: Access grant concept + url: /concepts/access-grant.html + - name: Access token concept + url: /concepts/access-token.html + - name: AccessGrant resource + url: /resources/grant.html + - name: AccessToken resource + url: /resources/claim.html --- # Token command diff --git a/input/concepts/access-grant.md b/input/concepts/access-grant.md new file mode 100644 index 0000000..a5e3ca8 --- /dev/null +++ b/input/concepts/access-grant.md @@ -0,0 +1,20 @@ +--- +body_class: concept +links: + - name: Access token concept + url: /concepts/claim.html + - name: Token issue command + url: /commands/token-issue.html +--- + +# Access grant concept + +
+ +Permission to redeem access tokens for links to the local +site. A remote site can use a token containing the grant +URL and secret code to obtain a certificate signed by the +grant's certificate authority (CA), within a certain +expiration window and for a limited number of redemptions. + +
diff --git a/input/concepts/access-token.md b/input/concepts/access-token.md new file mode 100644 index 0000000..9b97886 --- /dev/null +++ b/input/concepts/access-token.md @@ -0,0 +1,18 @@ +--- +body_class: concept +links: + - name: Access grant concept + url: /concepts/grant.html + - name: Token redeem command + url: /commands/token-redeem.html +--- + +# Access token concept + +
+ +A transferrable token redeemable for a link to a remote +site. An access token contains the URL and secret code of a +corresponding access grant. + +
diff --git a/input/concepts/index.md b/input/concepts/index.md index 2b9a5f8..cbb1d00 100644 --- a/input/concepts/index.md +++ b/input/concepts/index.md @@ -18,8 +18,8 @@ links: - [Link](link.html) - [Link access](link-access.html) - - [Access grant](grant.html) - - [Access token](claim.html) + - [Access grant](access-grant.html) + - [Access token](access-token.html) #### Service exposure - [Service](service.html) diff --git a/input/resources/claim.md b/input/resources/claim.md index 551588a..0637169 100644 --- a/input/resources/claim.md +++ b/input/resources/claim.md @@ -1,8 +1,6 @@ --- body_class: resource links: - - name: Access token concept - url: /concepts/claim.html - name: AccessGrant resource url: /resources/grant.html - name: Token redeem command diff --git a/input/resources/connector.md b/input/resources/connector.md index 6550420..6beb5c5 100644 --- a/input/resources/connector.md +++ b/input/resources/connector.md @@ -3,10 +3,10 @@ body_class: resource links: - name: Connector concept url: /concepts/connector.html - - name: Listener resource - url: /resources/listener.html - name: Connector command url: /commands/connector.html + - name: Listener resource + url: /resources/listener.html --- # Connector resource diff --git a/input/resources/grant.md b/input/resources/grant.md index a931b7a..e91ea7e 100644 --- a/input/resources/grant.md +++ b/input/resources/grant.md @@ -1,8 +1,6 @@ --- body_class: resource links: - - name: Access grant concept - url: /concepts/grant.html - name: AccessToken resource url: /resources/claim.html - name: Token issue command diff --git a/input/resources/link.md b/input/resources/link.md index e2722cc..ef99fda 100644 --- a/input/resources/link.md +++ b/input/resources/link.md @@ -3,12 +3,12 @@ body_class: resource links: - name: Link concept url: /concepts/link.html + - name: Link command + url: /commands/link.html - name: AccessGrant resource url: /resources/grant.html - name: AccessToken resource url: /resources/claim.html - - name: Link command - url: /commands/link.html --- # Link resource diff --git a/input/resources/listener.md b/input/resources/listener.md index 01140f7..92a01db 100644 --- a/input/resources/listener.md +++ b/input/resources/listener.md @@ -3,10 +3,10 @@ body_class: resource links: - name: Listener concept url: /concepts/listener.html - - name: Connector resource - url: /resources/connector.html - name: Listener command url: /commands/listener.html + - name: Connector resource + url: /resources/connector.html --- # Listener resource diff --git a/input/resources/site.md b/input/resources/site.md index 771e7d4..95c7a93 100644 --- a/input/resources/site.md +++ b/input/resources/site.md @@ -3,14 +3,14 @@ body_class: resource links: - name: Site concept url: /concepts/site.html + - name: Site command + url: /commands/site.html - name: Network concept url: /concepts/network.html - name: Namespace concept url: /concepts/namespace.html - name: Link resource url: /resources/link.html - - name: Site command - url: /commands/site.html --- # Site resource diff --git a/python/common.py b/python/common.py index bae92c1..978fd94 100644 --- a/python/common.py +++ b/python/common.py @@ -22,7 +22,8 @@ def add_link(other): lines.append(f" - name: {capitalize(other.rename)} {type}") lines.append(f" url: /{plural(type)}/{other.id}.html") - # XXX corresponding objects + for other in obj.corresponding_objects: + add_link(other) for concept in obj.related_concepts: add_link(concept) @@ -161,15 +162,36 @@ def id(self): return get_fragment_id(self.name) @property - def related_concepts(self): + def corresponding_objects(self): from concepts import Concept + from resources import Resource + from commands import Command + + name = self.name + + if isinstance(self, Command) and self.parent is not None: + name = self.parent.name if not isinstance(self, Concept): try: - yield self.model.concept_model.concepts_by_name[self.name.lower()] + yield self.model.concept_model.concepts_by_name[name.lower()] except KeyError: pass + if not isinstance(self, Resource): + try: + yield self.model.resource_model.resources_by_name[capitalize(name)] + except KeyError: + pass + + if not isinstance(self, Command) or (isinstance(self, Command) and self.parent is not None): + try: + yield self.model.command_model.commands_by_name[name.lower()] + except KeyError: + pass + + @property + def related_concepts(self): for name in self.data.get("related_concepts", []): try: yield self.model.concept_model.concepts_by_name[name] @@ -178,14 +200,6 @@ def related_concepts(self): @property def related_resources(self): - from resources import Resource - - if not isinstance(self, Resource): - try: - yield self.model.resource_model.resources_by_name[capitalize(self.name)] - except KeyError: - pass - for name in self.data.get("related_resources", []): try: yield self.model.resource_model.resources_by_name[name] @@ -194,14 +208,6 @@ def related_resources(self): @property def related_commands(self): - from commands import Command - - if not isinstance(self, Command): - try: - yield self.model.command_model.commands_by_name[self.name.lower()] - except KeyError: - pass - for name in self.data.get("related_commands", []): try: yield self.model.command_model.commands_by_name[name]