Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 6 additions & 4 deletions docker/mono-engine-dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ COPY . .

# build
RUN if [ "$BUILD_TYPE" = "release" ]; then \
cargo build -p mono --release; \
else \
cargo build -p mono; \
fi
cargo build -p mono --release && cargo build -p libra --release; \
else \
cargo build -p mono && cargo build -p libra; \
fi

# final image
FROM debian:bookworm-slim
Expand All @@ -51,6 +51,8 @@ RUN apt-get update && apt-get install -y libssl-dev ca-certificates
ARG BUILD_TYPE=release

COPY --from=builder /opt/mega/target/$BUILD_TYPE/mono /usr/local/bin/mono
COPY --from=builder /opt/mega/target/$BUILD_TYPE/libra /usr/local/bin/libra

COPY --from=builder /opt/mega/docker/start-mono.sh /usr/local/bin/start-mono.sh
RUN chmod +x /usr/local/bin/start-mono.sh
RUN chmod +x /usr/local/bin/mono
Expand Down
10 changes: 10 additions & 0 deletions saturn/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ mod test {

let app_context = load_context(entities);
let admin: EntityUid = r#"User::"benjamin.747""#.parse().unwrap();
let maintainer: EntityUid = r#"User::"besscroft""#.parse().unwrap();
let anyone: EntityUid = r#"User::"anyone""#.parse().unwrap();
let resource: EntityUid = r#"Repository::"project""#.parse().unwrap();

Expand Down Expand Up @@ -166,6 +167,15 @@ mod test {
Context::empty()
)
.is_err_and(|e| matches!(e, Error::AuthDenied(_))));

assert!(app_context
.is_authorized(
&maintainer,
r#"Action::"approveMergeRequest""#.parse::<EntityUid>().unwrap(),
&resource,
Context::empty()
)
.is_ok());
}

#[test]
Expand Down
14 changes: 10 additions & 4 deletions saturn/test/project/.mega.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"UserGroup::\"admin\""
]
},
"User::\"besscroft\"": {
"euid": "User::\"besscroft\"",
"parents": [
"UserGroup::\"maintainer\""
]
},
"User::\"genedna\"": {
"euid": "User::\"genedna\"",
"parents": [
Expand All @@ -18,7 +24,7 @@
"euid": "Repository::\"project\"",
"is_private": false,
"admins": "UserGroup::\"admin\"",
"maintainers": "UserGroup::\"matainer\"",
"maintainers": "UserGroup::\"maintainer\"",
"readers": "UserGroup::\"reader\"",
"parents": []
}
Expand All @@ -27,11 +33,11 @@
"UserGroup::\"admin\"": {
"euid": "UserGroup::\"admin\"",
"parents": [
"UserGroup::\"matainer\""
"UserGroup::\"maintainer\""
]
},
"UserGroup::\"matainer\"": {
"euid": "UserGroup::\"matainer\"",
"UserGroup::\"maintainer\"": {
"euid": "UserGroup::\"maintainer\"",
"parents": [
"UserGroup::\"reader\""
]
Expand Down
8 changes: 4 additions & 4 deletions saturn/test/project/private/.mega.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"euid": "Repository::\"/project/bens_private\"",
"is_private": true,
"admins": "UserGroup::\"admin\"",
"maintainers": "UserGroup::\"matainer\"",
"maintainers": "UserGroup::\"maintainer\"",
"readers": "UserGroup::\"reader\"",
"parents": []
}
Expand All @@ -21,11 +21,11 @@
"UserGroup::\"admin\"": {
"euid": "UserGroup::\"admin\"",
"parents": [
"UserGroup::\"matainer\""
"UserGroup::\"maintainer\""
]
},
"UserGroup::\"matainer\"": {
"euid": "UserGroup::\"matainer\"",
"UserGroup::\"maintainer\"": {
"euid": "UserGroup::\"maintainer\"",
"parents": [
"UserGroup::\"reader\""
]
Expand Down