Skip to content

Commit

Permalink
Merge pull request #20 from rtucker-mozilla/add_ghe_groups_to_ndad
Browse files Browse the repository at this point in the history
adding ghe_group_curators to list of NDA_GROUPS
  • Loading branch information
rtucker-mozilla authored Sep 16, 2021
2 parents 39ad801 + eb801a8 commit d4dc1c5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-18.04

services:
postgres:
Expand All @@ -28,7 +28,13 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Run fmt
- name: Install Rust 1.46.0
uses: actions-rs/toolchain@v1
with:
toolchain: 1.46.0
override: true
components: rustfmt, clippy
- name: FMT
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all --all-features -- -D warnings
Expand Down
7 changes: 4 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ local = ["dino_park_gate/localuserscope"]
[dependencies]
cis_client = { git = "https://github.com/mozilla-iam/cis_client-rust", branch = "0.7", version = "0.7" }
cis_profile = { git = "https://github.com/mozilla-iam/cis_profile-rust", branch = "0.4", version = "0.4", features = ["aws", "vendored"] }
dino_park_gate = { git = "https://github.com/mozilla-iam/dino-park-gate", branch = "0.8", version = "0.8" }
dino_park_gate = { git = "https://github.com/mozilla-iam/dino-park-gate", branch = "0.8.1", version = "0.8.1" }
dino_park_guard = { git = "https://github.com/mozilla-iam/dino-park-guard", branch = "0.3", version = "0.3" }
dino_park_trust = { git = "https://github.com/mozilla-iam/dino-park-trust", tag = "0.0.7", version = "0.0.7" }
diesel = { version = "1.4", features = ["postgres", "uuidv07", "r2d2", "chrono", "serde_json"] }
lexical-core = "0.7.5"
diesel_migrations = "1.4"
actix-web = "3"
actix-rt = "1"
Expand Down
10 changes: 4 additions & 6 deletions src/db/users.rs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ macro_rules! user_t {
($user_typ:ident, $table:expr, $display:expr) => {
#[derive(Identifiable, Queryable, PartialEq, Debug, Insertable, AsChangeset)]
#[primary_key(user_uuid)]
#[changeset_options(treat_none_as_null="true")]
#[changeset_options(treat_none_as_null = "true")]
#[table_name = $table]
pub struct $user_typ {
pub user_uuid: Uuid,
Expand Down Expand Up @@ -171,17 +171,15 @@ macro_rules! user_t {
impl From<&Profile> for $user_typ {
fn from(profile: &Profile) -> $user_typ {
$user_typ {
user_uuid: Uuid::parse_str(
&profile.uuid.value.clone().unwrap_or_default()
).unwrap_or_default(),
user_uuid: Uuid::parse_str(&profile.uuid.value.clone().unwrap_or_default())
.unwrap_or_default(),
picture: field_for_display(&profile.picture, &$display),
first_name: field_for_display(&profile.first_name, &$display),
last_name: field_for_display(&profile.last_name, &$display),
username: profile.primary_username.value.clone().unwrap_or_default(),
email: field_for_display(&profile.primary_email, &$display),
trust: trust_for_profile(profile)
trust: trust_for_profile(profile),
}

}
}
};
Expand Down
7 changes: 6 additions & 1 deletion src/rules/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ use crate::rules::RuleContext;
use crate::utils::valid_group_name;
use dino_park_trust::GroupsTrust;

const NDA_GROUPS: [&str; 2] = ["nda", "contingentworkernda"];
/*
The other places these groups are handled.
https://github.com/mozilla-iam/dino-park-gate/pull/3
https://github.com/mozilla-iam/dino-park-front-end/pull/662
*/
const NDA_GROUPS: [&str; 3] = ["nda", "contingentworkernda", "ghe_group_curators"];

pub fn is_nda_group(group_name: &str) -> bool {
NDA_GROUPS.contains(&group_name)
Expand Down

0 comments on commit d4dc1c5

Please sign in to comment.