Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ops: promote 1.26 #281

Merged
merged 27 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
24b4f41
update glob: [skip actions]
invalid-email-address Apr 9, 2024
1addbe9
Add %settings-data and %credentials to mark-warmer
patosullivan May 31, 2024
b0aab57
Add %configuration to the mark warmer
patosullivan May 31, 2024
bf55d6e
fix name issue
patosullivan May 31, 2024
95f01ef
Merge pull request #275 from tloncorp/po/add-settings-and-credentials…
patosullivan May 31, 2024
6cd2ddd
add storage-update to mark warmer
patosullivan Jun 14, 2024
a3d2aab
Merge pull request #276 from tloncorp/po/add-storage-update-to-mark-w…
patosullivan Jun 14, 2024
9bae4ae
reel: updating to new flow with tests
arthyn Aug 27, 2024
eaa1177
reel: updating to new flow with tests
arthyn Aug 27, 2024
a244128
Fix issue with subscribeOnce to reel's token-link not always returnin…
patosullivan Aug 28, 2024
51d8fac
reel: make sure we don't make the same link again
arthyn Aug 29, 2024
9c68eb2
bait: modifications to support new flow
arthyn Aug 29, 2024
dbfdaee
Merge pull request #277 from tloncorp/po/tlon-2526-group-invites
patosullivan Aug 30, 2024
28a5c4b
bait: better conditional ordering
arthyn Sep 3, 2024
e739487
reel,bait: improving types, fixing tests, adding body to 404s
arthyn Sep 3, 2024
9514fa2
Merge branch 'hm/lure-attribution' of github.com:tloncorp/landscape i…
arthyn Sep 3, 2024
5919bf6
bait: using type aliases, fixing pr feedback
arthyn Sep 3, 2024
7448dc7
reel: clarifying open-link-requests comment
arthyn Sep 3, 2024
f92e40f
Merge branch 'develop' of github.com:tloncorp/landscape into develop
arthyn Sep 3, 2024
9c211f7
Merge branch 'develop' into hm/lure-attribution
arthyn Sep 3, 2024
7e109b1
Merge pull request #278 from tloncorp/hm/lure-attribution
arthyn Sep 4, 2024
9bbc39a
reel: fixing meta and url scries, token rotation, and extra metadata
arthyn Sep 6, 2024
5e2b00c
reel: better indentation
arthyn Sep 9, 2024
e4d0838
reel: better tis work and updating tests
arthyn Sep 9, 2024
1144a16
Merge branch 'hm/small-reel-fixes' of github.com:tloncorp/landscape i…
arthyn Sep 9, 2024
c1751fe
Merge pull request #279 from tloncorp/hm/small-reel-fixes
arthyn Sep 9, 2024
404c038
ops: version bump
arthyn Sep 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 89 additions & 28 deletions desk/app/bait.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
+$ versioned-state
$% state-0
state-1
state-2
==
::
+$ state-0
Expand All @@ -15,6 +16,10 @@
$: %1
token-metadata=(map [inviter=ship token=cord] metadata:reel)
==
+$ state-2
$: %2
token-metadata=(map token:reel metadata:reel)
==
--
::
|%
Expand Down Expand Up @@ -53,7 +58,7 @@
==
--
::
=| state-1
=| state-2
=* state -
::
%- agent:dbug
Expand All @@ -72,10 +77,22 @@
^- (quip card _this)
=/ old !<(versioned-state old-state)
?- -.old
%1
%2
`this(state old)
::
%1
=/ new-metadata
%- ~(gas by *(map token:reel metadata:reel))
%+ turn
~(tap by token-metadata.old)
|= [[inviter=ship =token:reel] meta=metadata:reel]
=/ new-token
(rap 3 (scot %p inviter) '/' token ~)
[new-token meta]
`this(state [%2 new-metadata])
::
%0
`this(state *state-1)
`this(state *state-2)
==
::
++ on-poke
Expand All @@ -88,53 +105,97 @@
:_ this
=/ full-line=request-line:server (parse-request-line:server url.request)
=/ line
?: ?=([%lure @ @ *] site.full-line)
?: ?=([%lure @ *] site.full-line)
t.site.full-line
?: ?=([@ @ *] site.full-line)
site.full-line
!!
?+ method.request (give not-found:gen:server)
%'GET'
?: ?=([%bait %who ~] line)
(give (json-response:gen:server s+(scot %p our.bowl)))
=/ inviter (slav %p i.line)
=/ token i.t.line
=/ =metadata:reel (fall (~(get by token-metadata) [inviter token]) *metadata:reel)
?: ?=([@ @ %metadata ~] line)
(give (json-response:gen:server (enjs-metadata metadata)))
(give (manx-response:gen:server (landing-page metadata)))
%'GET' (get-request line)
::
%'POST'
=/ inviter (slav %p i.line)
=/ token i.t.line
?~ body.request
(give not-found:gen:server)
(give-not-found 'body not found')
?. =('ship=%7E' (end [3 8] q.u.body.request))
(give not-found:gen:server)
(give-not-found 'ship not found in body')
=/ joiner (slav %p (cat 3 '~' (rsh [3 8] q.u.body.request)))
:* :* %pass /bite %agent [inviter %reel]
%poke %reel-bite !>([%bite-1 token joiner inviter])
==
:* %pass /bite %agent [our.bowl %reel]
%poke %reel-bite !>([%bite-1 token joiner inviter])
==
(give (manx-response:gen:server (sent-page joiner)))
==
=; [=bite:reel inviter=(unit ship)]
?~ inviter
(give-not-found 'inviter not found')
^- (list card)
:: TODO: figure out if we need to send both pokes
:* :* %pass /bite %agent [u.inviter %reel]
%poke %reel-bite !>(bite)
==
:* %pass /bite %agent [our.bowl %reel]
%poke %reel-bite !>(bite)
==
(give (manx-response:gen:server (sent-page joiner)))
==
=/ =(pole knot) line
?: ?=([@ @ ~] line)
=/ inviter (slav %p i.line)
=/ old-token i.t.line
:_ `inviter
[%bite-1 old-token joiner inviter]
=/ token
?~ ext.full-line i.line
(crip "{(trip i.line)}.{(trip u.ext.full-line)}")
=/ =metadata:reel (~(gut by token-metadata) token *metadata:reel)
?~ type=(~(get by fields.metadata) 'bite-type')
~|("no bite type for token: {<token>}" !!)
?> =('2' u.type)
:- [%bite-2 token joiner metadata]
?~ inviter-field=(~(get by fields.metadata) 'inviter') ~
`(slav %p u.inviter-field)
==
++ get-request
|= =(pole knot)
^- (list card)
?+ pole (give not-found:gen:server)
[%bait %who ~]
(give (json-response:gen:server s+(scot %p our.bowl)))
::
[ship=@ name=@ %metadata ~]
=/ token (crip "{(trip ship.pole)}/{(trip name.pole)}")
=/ =metadata:reel
(~(gut by token-metadata) token *metadata:reel)
(give (json-response:gen:server (enjs-metadata metadata)))
::
[token=@ %metadata ~]
=/ =metadata:reel
(~(gut by token-metadata) token.pole *metadata:reel)
(give (json-response:gen:server (enjs-metadata metadata)))
::
[token=* ~]
=/ token (crip (join '/' pole))
=/ =metadata:reel
(~(gut by token-metadata) token *metadata:reel)
(give (manx-response:gen:server (landing-page metadata)))
==
::
++ give-not-found
|= body=cord
(give [[404 ~] `(as-octs:mimes:html body)])
++ give
|= =simple-payload:http
(give-simple-payload:app:server id simple-payload)
--
%bait-describe
=+ !<([token=cord =metadata:reel] vase)
`this(token-metadata (~(put by token-metadata) [src.bowl token] metadata))
=+ !<([=nonce:reel =metadata:reel] vase)
=/ =token:reel (scot %uv (end [3 16] eny.bowl))
:_ this(token-metadata (~(put by token-metadata) token metadata))
=/ =cage reel-confirmation+!>([nonce token])
~[[%pass /confirm/[nonce] %agent [src.bowl %reel] %poke cage]]
::
%bait-undescribe
=+ !<(token=cord vase)
`this(token-metadata (~(del by token-metadata) [src.bowl token]))
`this(token-metadata (~(del by token-metadata) token))
::
%bind-slash
:_ this
~[[%pass /eyre/connect %arvo %e %connect [~ /] dap.bowl]]
::
%unbind-slash
:_ this
~[[%pass /eyre/connect %arvo %e %connect [~ /] %docket]]
Expand Down
Loading
Loading