From 966925b38eacf976ca5c78d2f6b5a11c434f5fd0 Mon Sep 17 00:00:00 2001 From: pineros <61841991+pineros@users.noreply.github.com> Date: Tue, 2 May 2023 12:26:36 -0400 Subject: [PATCH 1/5] Managed by Terraform --- .github/workflows/thirteen.yml | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/thirteen.yml diff --git a/.github/workflows/thirteen.yml b/.github/workflows/thirteen.yml new file mode 100644 index 0000000..34d48a1 --- /dev/null +++ b/.github/workflows/thirteen.yml @@ -0,0 +1,37 @@ +name: Trigger Thirteen AWS CodePipeline + +on: + push: + branches: + - 'dev' + - 'preprod' + - 'main' + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Trigger Thirteen DEV AWS CodePipeline + uses: zulhfreelancer/aws-codepipeline-action@v1.0.7 + if: github.ref == 'refs/heads/dev' + with: + aws-region: "us-east-1" + aws-access-key: ${{ secrets.DEV_AWS_CODEPIPELINE_ACCESS_KEY }} + aws-secret-key: ${{ secrets.DEV_AWS_CODEPIPELINE_SECRET_KEY }} + pipeline-name: "Thirteen" + - name: Trigger Thirteen PREPROD AWS CodePipeline + uses: zulhfreelancer/aws-codepipeline-action@v1.0.7 + if: github.ref == 'refs/heads/preprod' + with: + aws-region: "us-east-1" + aws-access-key: ${{ secrets.PREPROD_AWS_CODEPIPELINE_ACCESS_KEY }} + aws-secret-key: ${{ secrets.PREPROD_AWS_CODEPIPELINE_SECRET_KEY }} + pipeline-name: "Thirteen" + - name: Trigger Thirteen PROD AWS CodePipeline + uses: zulhfreelancer/aws-codepipeline-action@v1.0.7 + if: github.ref == 'refs/heads/main' + with: + aws-region: "us-east-1" + aws-access-key: ${{ secrets.PROD_AWS_CODEPIPELINE_ACCESS_KEY }} + aws-secret-key: ${{ secrets.PROD_AWS_CODEPIPELINE_SECRET_KEY }} + pipeline-name: "Thirteen" \ No newline at end of file From a8fe3506d76a2541808ca072396655d2ff8c61ef Mon Sep 17 00:00:00 2001 From: pineros <61841991+pineros@users.noreply.github.com> Date: Mon, 5 Jun 2023 15:39:52 -0400 Subject: [PATCH 2/5] Managed by Terraform --- .github/workflows/thirteen.yml | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/thirteen.yml diff --git a/.github/workflows/thirteen.yml b/.github/workflows/thirteen.yml new file mode 100644 index 0000000..34d48a1 --- /dev/null +++ b/.github/workflows/thirteen.yml @@ -0,0 +1,37 @@ +name: Trigger Thirteen AWS CodePipeline + +on: + push: + branches: + - 'dev' + - 'preprod' + - 'main' + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Trigger Thirteen DEV AWS CodePipeline + uses: zulhfreelancer/aws-codepipeline-action@v1.0.7 + if: github.ref == 'refs/heads/dev' + with: + aws-region: "us-east-1" + aws-access-key: ${{ secrets.DEV_AWS_CODEPIPELINE_ACCESS_KEY }} + aws-secret-key: ${{ secrets.DEV_AWS_CODEPIPELINE_SECRET_KEY }} + pipeline-name: "Thirteen" + - name: Trigger Thirteen PREPROD AWS CodePipeline + uses: zulhfreelancer/aws-codepipeline-action@v1.0.7 + if: github.ref == 'refs/heads/preprod' + with: + aws-region: "us-east-1" + aws-access-key: ${{ secrets.PREPROD_AWS_CODEPIPELINE_ACCESS_KEY }} + aws-secret-key: ${{ secrets.PREPROD_AWS_CODEPIPELINE_SECRET_KEY }} + pipeline-name: "Thirteen" + - name: Trigger Thirteen PROD AWS CodePipeline + uses: zulhfreelancer/aws-codepipeline-action@v1.0.7 + if: github.ref == 'refs/heads/main' + with: + aws-region: "us-east-1" + aws-access-key: ${{ secrets.PROD_AWS_CODEPIPELINE_ACCESS_KEY }} + aws-secret-key: ${{ secrets.PROD_AWS_CODEPIPELINE_SECRET_KEY }} + pipeline-name: "Thirteen" \ No newline at end of file From 1d44256480c5b70f2688ec4fd121f073e87631b4 Mon Sep 17 00:00:00 2001 From: William Tam Date: Mon, 14 Aug 2023 15:04:30 -0400 Subject: [PATCH 3/5] warning fixes --- classes/class-PBS-LAAS-client.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/classes/class-PBS-LAAS-client.php b/classes/class-PBS-LAAS-client.php index 38feb6e..eb710ba 100644 --- a/classes/class-PBS-LAAS-client.php +++ b/classes/class-PBS-LAAS-client.php @@ -184,7 +184,7 @@ public function check_pbs_login() { } $updated_tokeninfo = $this->update_pbs_tokeninfo($current_tokeninfo); - $access_token = $updated_tokeninfo['access_token']; + $access_token = isset($updated_tokeninfo['access_token']) ? $updated_tokeninfo['access_token'] : false; if (! $access_token) { // they're not logged in @@ -378,6 +378,7 @@ private function decrypt($cyphertext=''){ private function retrieve_encrypted_tokeninfo() { + $tokeninfo = false; // check for encrypted tokeninfo in cookie if (isset($_COOKIE[$this->tokeninfo_cookiename])){ @@ -389,8 +390,9 @@ private function retrieve_encrypted_tokeninfo() { if ($decrypted) { $tokeninfo = $decrypted; } - - $tokeninfo = json_decode($tokeninfo, true); + if (!empty($tokeninfo)) { + $tokeninfo = json_decode($tokeninfo, true); + } return $tokeninfo; } From 30001517a889084504e0e4e80d47075361b2b34e Mon Sep 17 00:00:00 2001 From: William Tam Date: Mon, 14 Aug 2023 15:44:24 -0400 Subject: [PATCH 4/5] fix various warnings and ver bump --- classes/class-pbs-passport-authenticate.php | 7 ++++--- pbs-passport-authenticate.php | 2 +- templates/authenticate.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/classes/class-pbs-passport-authenticate.php b/classes/class-pbs-passport-authenticate.php index a811937..1fafee8 100644 --- a/classes/class-pbs-passport-authenticate.php +++ b/classes/class-pbs-passport-authenticate.php @@ -23,7 +23,7 @@ public function __construct($file) { $this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $file ) ) ); $this->token = 'pbs_passport_authenticate'; $this->defaults = get_option($this->token); - $this->version = '0.3.1.4'; + $this->version = '0.3.1.5'; // Load public-facing style sheet and JavaScript. add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); @@ -90,8 +90,9 @@ public function rewrite_templates($template) { public function ppa_body_classes( $classes ) { if (!empty(get_query_var('pbsoauth'))) { if (in_array(get_query_var('pbsoauth'), array('authenticate','callback','loginform','activate','userinfo','vppa' ))) { - $classes[] = 'pbsoauth'; - if ($classes[0] == 'home') { unset($classes[0]); } + $classes[] = 'pbsoauth'; + #jic the first element in $classes is 'home' remove it + if (reset($classes) == 'home') { array_shift($classes); } } } return $classes; diff --git a/pbs-passport-authenticate.php b/pbs-passport-authenticate.php index 2b5d7d9..6ad6bd5 100644 --- a/pbs-passport-authenticate.php +++ b/pbs-passport-authenticate.php @@ -1,7 +1,7 @@ get_oauth_links(array('scope' => 'account vppa')); // We will now attempt to determine what the users current login_provider is // mvault is fallback - $login_provider = !empty($mvaultinfo["pbs_profile"]["login_provider"]) ? strtolower($mvaultinfo["profile"]["pbs_login_provider"]) : false; + $login_provider = !empty($mvaultinfo["pbs_profile"]["login_provider"]) ? strtolower($mvaultinfo["pbs_profile"]["login_provider"]) : false; if ( !in_array($login_provider, array("pbs", "google", "facebook", "apple") ) ) { $login_provider = "pbs"; } From dfbfd74f0358009b44ddcc6840ebcc14f4644a7d Mon Sep 17 00:00:00 2001 From: William Tam Date: Mon, 14 Aug 2023 16:13:52 -0400 Subject: [PATCH 5/5] cleanup warnings if theres no errors --- templates/authenticate.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/templates/authenticate.php b/templates/authenticate.php index 5c73e95..181b16b 100644 --- a/templates/authenticate.php +++ b/templates/authenticate.php @@ -68,12 +68,16 @@ if (isset($_REQUEST["membership_id"])){ $mvault_id = $_REQUEST["membership_id"]; $mvaultinfo = $mvault_client->activate($mvault_id, $pbs_uid); - $errors['activate'] = $mvaultinfo['errors']; + if (isset($mvaultinfo['errors'])) { + $errors['activate'] = $mvaultinfo['errors']; + } } if (! isset($mvaultinfo["membership_id"])) { // get the mvault record if available - $mvaultinfo = $mvault_client->get_membership_by_uid($pbs_uid); - $errors['byuid'] = $mvaultinfo['errors']; + $mvaultinfo = $mvault_client->get_membership_by_uid($pbs_uid); + if (isset($mvaultinfo['errors'])) { + $errors['byuid'] = $mvaultinfo['errors']; + } } // preset these for later cleanup $userinfo["membership_info"] = array("offer" => null, "status" => "Off");