Skip to content

Commit

Permalink
gora: restore cult functionality
Browse files Browse the repository at this point in the history
Release 3.0.2
  • Loading branch information
rabsef-bicrym authored Jan 11, 2023
2 parents 0d67e9f + 2a9cd96 commit 226a29d
Show file tree
Hide file tree
Showing 34 changed files with 1,552 additions and 63 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.0.2] - 2023-01-11

### Fixed

- (Hoon) Fix cults for new groups

## [3.0.1] - 2022-11-17

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.1
3.0.2
12 changes: 9 additions & 3 deletions sail/cult/cult.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,12 @@
[%pass /gnosis/[now] %agent [our.dish %groups] %poke cag]
:- %group-create
!> ^- create:gup
:^ q.flag 'a cult' 'keep it secret, sorta'
:^ 'https://bit.ly/3Czi3GK' '#ffd966' [%shut ~ ~]
(~(put ju *(jug ship term)) our.dish %admin)
:* q.flag
'a cult'
'keep it secret, sorta'
'https://freedom-club.sfo2.digitaloceanspaces.com/props/quartus/long-logo/ab_Quartus-05_only.png'
['#bb2649' [%shut ~ ~] ~ %|]
==
::
++ go-diff
|= d=diff
Expand All @@ -331,18 +334,21 @@
?=(^ pit)
:_ caz
%- punch
^- action:gup
:+ flag now.dish
[%cordon [%shut [%add-ships %pending pit]]]
=? caz
?=(^ pil)
:_ caz
%- punch
^- action:gup
:+ flag now.dish
[%cordon [%shut [%del-ships %pending pil]]]
=? caz
?=(^ pip)
:_ caz
%- punch
^- action:gup
[flag [now.dish [%fleet pip [%del ~]]]]
caz
|= a=action:gup
Expand Down
15 changes: 15 additions & 0 deletions sail/cult/sur/epic.hoon
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
|%
:: $saga: version synchronisation state
:: %dex: publisher is ahead
:: %lev: we are ahead
:: %chi: full sync
::
+$ saga
$% [%dex ver=@ud]
[%lev ~]
[%chi ~]
==

+$ epic @ud
::
--
39 changes: 39 additions & 0 deletions sail/cult/sur/group-store.hoon
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/- *group, *resource
^?
|%
::
:: $action: request to change group-store state
::
:: %add-group: add a group
:: %add-members: add members to a group
:: %remove-members: remove members from a group
:: %add-tag: add a tag to a set of ships
:: %remove-tag: remove a tag from a set of ships
:: %change-policy: change a group's policy
:: %remove-group: remove a group from the store
:: %expose: unset .hidden flag
::
+$ action
$% [%add-group =resource =policy hidden=?]
[%add-members =resource ships=(set ship)]
[%remove-members =resource ships=(set ship)]
[%add-tag =resource =tag ships=(set ship)]
[%remove-tag =resource =tag ships=(set ship)]
[%change-policy =resource =diff:policy]
[%remove-group =resource ~]
[%expose =resource ~]
==
:: $update: a description of a processed state change
::
:: %initial: describe groups upon new subscription
::
+$ update
$% initial
action
==
+$ initial
$% [%initial-group =resource =group]
[%initial =groups]
==
--

109 changes: 109 additions & 0 deletions sail/cult/sur/group.hoon
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/- *resource
::
^?
|%
::
++ groups-state-one
|%
+$ groups (map resource group)
::
+$ tag $@(group-tag [app=term tag=term])
::
+$ tags (jug tag ship)
::
+$ group
$: members=(set ship)
=tags
=policy
hidden=?
==
--
:: $groups: a mapping from group-ids to groups
::
+$ groups (map resource group)
:: $group-tag: an identifier used by groups
::
:: These tags should have precise semantics, as they are shared across all
:: apps.
::
+$ group-tag ?(role-tag)
:: $tag: an identifier used to identify a subset of members
::
:: Tags may be used and recognised differently across apps.
:: for example, you could use tags like `%author`, `%bot`, `%flagged`...
::
+$ tag $@(group-tag [app=term =resource tag=term])
:: $role-tag: a kind of $group-tag that identifies a privileged user
::
:: These roles are
:: %admin: Administrator, can do everything except delete the group
:: %moderator: Moderator, can add/remove/ban users
:: %janitor: Has no special meaning inside group-store,
:: but may be given additional privileges in other apps.
::
+$ role-tag
?(%admin %moderator %janitor)
:: $tags: a mapping from a $tag to the members it identifies
::
+$ tags (jug tag ship)
:: $group: description of a group of users
::
:: .members: members of the group
:: .tag-queries: a map of tags to subsets of members
:: .policy: permissions for the group
:: .hidden: is group unmanaged
+$ group
$: members=(set ship)
=tags
=policy
hidden=?
==
:: $policy: access control for a group
::
++ policy
=< policy
|%
::
+$ policy
$% invite
open
==
:: $diff: change group policy
+$ diff
$% [%invite diff:invite]
[%open diff:open]
[%replace =policy]
==
:: $invite: allow only invited ships
++ invite
=< invite-policy
|%
::
+$ invite-policy
[%invite pending=(set ship)]
:: $diff: add or remove invites
::
+$ diff
$% [%add-invites invitees=(set ship)]
[%remove-invites invitees=(set ship)]
==
--
:: $open: allow all unbanned ships of approriate rank
::
++ open
=< open-policy
|%
::
+$ open-policy
[%open ban-ranks=(set rank:title) banned=(set ship)]
:: $diff: ban or allow ranks and ships
::
+$ diff
$% [%allow-ranks ranks=(set rank:title)]
[%ban-ranks ranks=(set rank:title)]
[%ban-ships ships=(set ship)]
[%allow-ships ships=(set ship)]
==
--
--
--
20 changes: 17 additions & 3 deletions sail/cult/sur/groups.hoon
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/- meta
/- meta, e=epic
/- old=group
/- grp=group-store
/- metadata-store
|%
:: $flag: ID for a group
::
Expand Down Expand Up @@ -128,7 +131,9 @@
zone-ord=(list zone)
=bloc
=channels:channel
imported=(set nest)
=cordon
secret=?
meta=data:meta
==
::
Expand Down Expand Up @@ -237,6 +242,7 @@
[%cordon p=diff:cordon]
[%zone p=diff:zone]
[%meta p=data:meta]
[%secret p=?]
[%create p=group]
[%del ~]
==
Expand All @@ -261,12 +267,15 @@
cover=cord
=cordon
members=(jug ship sect)
secret=?
==
::
+$ init [=time =group]
::
+$ groups
(map flag group)
+$ net-groups
(map flag [net group])
::
:: $log: a time ordered map of all modifications to groups
::
Expand All @@ -281,8 +290,7 @@
+$ net
$~ [%pub ~]
$% [%pub p=log]
[%sub p=time]
[%load ~]
[%sub p=time load=_| =saga:e]
==
::
:: $join: a join request, can elect to join all channels
Expand Down Expand Up @@ -315,6 +323,7 @@
meta=data:meta
=cordon
=time
secret=?
==
::
+$ previews (map flag preview)
Expand All @@ -332,4 +341,9 @@
==
::
+$ gangs (map flag gang)
++ met metadata-store
::
+$ import [self=association:met chan=(map flag =association:met) roles=(set flag) =group:old]
::
+$ imports (map flag import)
--
Loading

0 comments on commit 226a29d

Please sign in to comment.