shrub/pkg/arvo/ted/gcp/is-configured.hoon
Jōshin 4aa9bba5b3
gcp: isConfigured doesn't touch store
Makes the thread return a simple boolean; almost as simple as just
returning %.y or %.n.

gcpManager now stores whether GCP is configured as a private variable.

Also fixes some type errors in gcp.
2021-04-06 19:08:53 +00:00

49 lines
805 B
Plaintext

:: Tells whether GCP Storage appears to be configured.
::
:: Thread since it needs to be called from Landscape.
::
::
/- gcp, spider, settings
/+ strandio
=, strand=strand:spider
^- thread:spider
|^
|= *
=/ m (strand ,vase)
^- form:m
;< has=? bind:m
%: has-settings
%client-email
%private-key
%private-key-id
%token-uri
~
==
%- pure:m
!>
^- json
b+has
::
++ has-settings
|= set=(list @tas)
=/ m (strand ?)
^- form:m
?~ set
(pure:m %.y)
;< has=? bind:m (has-setting i.set)
?. has
(pure:m %.n)
;< has=? bind:m (has-settings t.set)
(pure:m has)
::
++ has-setting
|= key=@tas
=/ m (strand ?)
^- form:m
;< has=? bind:m
%+ scry:strandio ?
/gx/settings-store/has-entry/gcp-store/[key]/noun
(pure:m has)
::
--