From 8745980f5604952bb2f9dbc68b15e7af8fdd78fd Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Thu, 9 Sep 2021 11:48:06 +1000 Subject: [PATCH] landscape: amend for setting-store namespacing --- pkg/garden-dev/sur/settings.hoon | 44 +++++++++++++++++++++++ pkg/garden/sur/settings.hoon | 45 +----------------------- pkg/landscape/desk.bill | 1 - pkg/landscape/desk.docket | 2 +- pkg/landscape/sur/settings.hoon | 1 + pkg/landscape/ted/gcp/get-token.hoon | 5 +-- pkg/landscape/ted/gcp/is-configured.hoon | 3 +- 7 files changed, 52 insertions(+), 49 deletions(-) create mode 100644 pkg/garden-dev/sur/settings.hoon mode change 100644 => 120000 pkg/garden/sur/settings.hoon create mode 120000 pkg/landscape/sur/settings.hoon diff --git a/pkg/garden-dev/sur/settings.hoon b/pkg/garden-dev/sur/settings.hoon new file mode 100644 index 0000000000..53e8691dba --- /dev/null +++ b/pkg/garden-dev/sur/settings.hoon @@ -0,0 +1,44 @@ +/+ *mip +|% +:: +++ settings-0 + =< settings + |% + +$ settings (map key bucket) + +$ bucket (map key val) + +$ val + $% [%s p=@t] + [%b p=?] + [%n p=@] + == + -- +:: +++ settings-1 + =< settings + |% + +$ settings (map key bucket) + -- ++$ bucket (map key val) ++$ key term ++$ val + $~ [%n 0] + $% [%s p=@t] + [%b p=?] + [%n p=@] + [%a p=(list val)] + == +:: ++$ settings (mip desk key bucket) ++$ event + $% [%put-bucket =desk =key =bucket] + [%del-bucket =desk =key] + [%put-entry =desk buc=key =key =val] + [%del-entry =desk buc=key =key] + == ++$ data + $% [%all =settings] + [%bucket =bucket] + [%desk desk=(map key bucket)] + [%entry =val] + == +-- diff --git a/pkg/garden/sur/settings.hoon b/pkg/garden/sur/settings.hoon deleted file mode 100644 index 53e8691dba..0000000000 --- a/pkg/garden/sur/settings.hoon +++ /dev/null @@ -1,44 +0,0 @@ -/+ *mip -|% -:: -++ settings-0 - =< settings - |% - +$ settings (map key bucket) - +$ bucket (map key val) - +$ val - $% [%s p=@t] - [%b p=?] - [%n p=@] - == - -- -:: -++ settings-1 - =< settings - |% - +$ settings (map key bucket) - -- -+$ bucket (map key val) -+$ key term -+$ val - $~ [%n 0] - $% [%s p=@t] - [%b p=?] - [%n p=@] - [%a p=(list val)] - == -:: -+$ settings (mip desk key bucket) -+$ event - $% [%put-bucket =desk =key =bucket] - [%del-bucket =desk =key] - [%put-entry =desk buc=key =key =val] - [%del-entry =desk buc=key =key] - == -+$ data - $% [%all =settings] - [%bucket =bucket] - [%desk desk=(map key bucket)] - [%entry =val] - == --- diff --git a/pkg/garden/sur/settings.hoon b/pkg/garden/sur/settings.hoon new file mode 120000 index 0000000000..c2c70beefe --- /dev/null +++ b/pkg/garden/sur/settings.hoon @@ -0,0 +1 @@ +../../garden-dev/sur/settings.hoon \ No newline at end of file diff --git a/pkg/landscape/desk.bill b/pkg/landscape/desk.bill index e5c48e0630..49f933eafa 100644 --- a/pkg/landscape/desk.bill +++ b/pkg/landscape/desk.bill @@ -35,7 +35,6 @@ %observe-hook %s3-store %sane - %settings-store %weather == :- %fish diff --git a/pkg/landscape/desk.docket b/pkg/landscape/desk.docket index 498fc4fc92..0dcf0783e5 100644 --- a/pkg/landscape/desk.docket +++ b/pkg/landscape/desk.docket @@ -1,7 +1,7 @@ :~ title+'Landscape' info+'A suite of applications to communicate on Urbit' color+0xee.5432 - glob+'https://bootstrap.urbit.org/glob-0v4.0k6hb.4s38v.su79d.10vd5.7c8lu.glob' + glob-http+'https://bootstrap.urbit.org/glob-0v4.0k6hb.4s38v.su79d.10vd5.7c8lu.glob' base+'landscape' version+[0 0 1] website+'https://tlon.io' diff --git a/pkg/landscape/sur/settings.hoon b/pkg/landscape/sur/settings.hoon new file mode 120000 index 0000000000..c2c70beefe --- /dev/null +++ b/pkg/landscape/sur/settings.hoon @@ -0,0 +1 @@ +../../garden-dev/sur/settings.hoon \ No newline at end of file diff --git a/pkg/landscape/ted/gcp/get-token.hoon b/pkg/landscape/ted/gcp/get-token.hoon index 3562aaf268..73fbbf3b12 100644 --- a/pkg/landscape/ted/gcp/get-token.hoon +++ b/pkg/landscape/ted/gcp/get-token.hoon @@ -44,15 +44,16 @@ ++ read-setting |= key=term =/ m (strand @t) ^- form:m + ;< =bowl:spider bind:m get-bowl:strandio ;< has=? bind:m %+ scry:strandio ? - /gx/settings-store/has-entry/gcp-store/[key]/noun + /gx/settings-store/has-entry/[q.byk.bowl]/gcp-store/[key]/noun ?. has (strand-fail:strandio (rap 3 %gcp-missing- key ~) ~) ;< =data:settings bind:m %+ scry:strandio data:settings - /gx/settings-store/entry/gcp-store/[key]/settings-data + /gx/settings-store/entry/[q.byk.bowl]/gcp-store/[key]/settings-data ?> ?=([%entry %s @] data) (pure:m p.val.data) :: diff --git a/pkg/landscape/ted/gcp/is-configured.hoon b/pkg/landscape/ted/gcp/is-configured.hoon index 8c32e7d41d..d750342a10 100644 --- a/pkg/landscape/ted/gcp/is-configured.hoon +++ b/pkg/landscape/ted/gcp/is-configured.hoon @@ -40,9 +40,10 @@ b+has |= key=@tas =/ m (strand ?) ^- form:m + ;< =bowl:spider bind:m get-bowl:strandio ;< has=? bind:m %+ scry:strandio ? - /gx/settings-store/has-entry/gcp-store/[key]/noun + /gx/settings-store/has-entry/[q.byk.bowl]/gcp-store/[key]/noun (pure:m has) :: --