Skip to content

Commit 912fa07

Browse files
authored
Merge pull request #8 from fiji-flo/reduce-github-scope
use public (none) scope for github
2 parents 7942c52 + ae9211a commit 912fa07

6 files changed

Lines changed: 639 additions & 752 deletions

File tree

Cargo.lock

Lines changed: 621 additions & 730 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ default = []
99
nouid = []
1010

1111
[dependencies]
12-
cis_client = { git = "https://github.com/fiji-flo/cis_client-rust", branch = "async-2", version = "0.1.0-beta.2" }
13-
cis_profile = { git = "https://github.com/fiji-flo/cis_profile-rust", branch = "0.1.0", version = "0.1.0" }
14-
oauth2 = "2.0.0-beta.2"
15-
url = "1.7.2"
12+
cis_client = { git = "https://github.com/fiji-flo/cis_client-rust", branch = "0.1.3", version = "0.1.3" }
13+
cis_profile = { git = "https://github.com/fiji-flo/cis_profile-rust", branch = "0.1.2", version = "0.1.2" }
14+
oauth2 = "2.0.0-beta.3"
15+
url = "1.7"
1616
base64 = "0.10.1"
1717
rand = "0.7"
1818
actix-web = { version = "1.0", features = ["ssl"] }

src/bugzilla/app.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use cis_profile::schema::Profile;
1919
use future::IntoFuture;
2020
use futures::future;
2121
use futures::Future;
22+
use log::info;
2223
use oauth2::basic::BasicClient;
2324
use oauth2::prelude::*;
2425
use oauth2::AuthUrl;

src/github/app.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use futures::future;
2020
use futures::future::Either;
2121
use futures::Future;
2222
use futures::IntoFuture;
23+
use log::info;
2324
use oauth2::basic::BasicClient;
2425
use oauth2::prelude::*;
2526
use oauth2::AuthUrl;
@@ -28,7 +29,6 @@ use oauth2::ClientId;
2829
use oauth2::ClientSecret;
2930
use oauth2::CsrfToken;
3031
use oauth2::RedirectUrl;
31-
use oauth2::Scope;
3232
use oauth2::TokenResponse;
3333
use oauth2::TokenUrl;
3434
use std::sync::Arc;
@@ -212,7 +212,6 @@ pub fn github_app<T: AsyncCisClientTrait + 'static>(
212212
auth_url,
213213
Some(token_url),
214214
)
215-
.add_scope(Scope::new("read:user".to_string()))
216215
.set_redirect_url(RedirectUrl::new(
217216
Url::parse(&format!("https://{}/whoami/github/auth", whoami.domain))
218217
.expect("Invalid redirect URL"),

src/main.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
11
#[macro_use]
2-
extern crate log;
3-
#[macro_use]
42
extern crate serde_derive;
5-
extern crate actix_cors;
6-
extern crate actix_session;
7-
extern crate actix_web;
8-
extern crate base64;
9-
extern crate chrono;
10-
extern crate cis_client;
11-
extern crate cis_profile;
12-
extern crate env_logger;
13-
extern crate futures;
14-
extern crate rand;
15-
extern crate serde_json;
16-
extern crate ttl_cache;
17-
extern crate url;
183

194
mod bugzilla;
205
mod github;
@@ -28,6 +13,7 @@ use crate::github::app::github_app;
2813
use actix_web::middleware::Logger;
2914
use actix_web::web;
3015
use actix_web::App;
16+
use log::info;
3117
use std::sync::Arc;
3218
use std::sync::RwLock;
3319
use ttl_cache::TtlCache;

terraform/codebuild/main.tf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,17 @@ resource "aws_codebuild_project" "build" {
4646
# Unomment this section if you do want to build automatically on push
4747
resource "aws_codebuild_webhook" "webhook" {
4848
project_name = aws_codebuild_project.build.name
49-
branch_filter = "^master$"
49+
filter_group {
50+
filter {
51+
type = "EVENT"
52+
pattern = "PUSH"
53+
}
54+
55+
filter {
56+
type = "HEAD_REF"
57+
pattern = "(^refs/heads/master$|^refs/tags/.*-(prod|test))"
58+
}
59+
}
5060
}
5161

5262
#---

0 commit comments

Comments
 (0)