Skip to content

Conversation

@1058274
Copy link
Contributor

@1058274 1058274 commented Jun 9, 2023

One-sentence description

AWS integration feature where each team in the current semester gets access to their own isolated AWS environment as part of the course.

Description

Pull request has been created as per client request. See the updated documentation for in-depth details on the new feature.

The current merge conflicts are from the Poetry files (and from not rebasing; too much effort for me) because this repository got a commit that needed TinyMCE dependencies while we were working in the forked repository that also needed boto3 and moto dependencies. I added both in last commit.

If you want things changed, I am down to help in my spare time after exam period.

henkberendsen and others added 30 commits February 24, 2023 11:01
* Added button to /admin/projects/project page on website

* Framework for AWS synchronisation button functionality

* Linked synchronisation button to framework

* Fixed import order to comply with flake8

* Added docstring to synchronise_to_AWS

* Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed.

* Added tests and changed awssync.py to allow for testing the button_pressed function.

* Removed unnecessary docstrings.
Add function for creating fresh AWS organization
* AWS synchronisation button (#8)

* Added button to /admin/projects/project page on website

* Framework for AWS synchronisation button functionality

* Linked synchronisation button to framework

* Fixed import order to comply with flake8

* Added docstring to synchronise_to_AWS

* Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed.

* Added tests and changed awssync.py to allow for testing the button_pressed function.

* Removed unnecessary docstrings.

* Add boto3 and moto dependencies (#11)

* Add logger and replace prints with logs

* Add function to create AWS organization

* Add unit tests for creating AWS organization

* bugfix (GiPHouse#619)

Co-authored-by: nvoers <nick-vanoers@hotmail.com>

---------

Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com>
Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com>
Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com>
Co-authored-by: nvoers <nick-vanoers@hotmail.com>
* AWS synchronisation button (#8)

* Added button to /admin/projects/project page on website

* Framework for AWS synchronisation button functionality

* Linked synchronisation button to framework

* Fixed import order to comply with flake8

* Added docstring to synchronise_to_AWS

* Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed.

* Added tests and changed awssync.py to allow for testing the button_pressed function.

* Removed unnecessary docstrings.

* Add boto3 and moto dependencies (#11)

* Add logger and replace prints with logs

* Add function to create AWS organization

* Add unit tests for creating AWS organization

* bugfix (GiPHouse#619)

Co-authored-by: nvoers <nick-vanoers@hotmail.com>

* Added logger setlevel (#20)

---------

Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com>
Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com>
Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com>
Co-authored-by: nvoers <nick-vanoers@hotmail.com>
Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com>
* Added button to /admin/projects/project page on website

* Framework for AWS synchronisation button functionality

* Linked synchronisation button to framework

* Fixed import order to comply with flake8

* Added docstring to synchronise_to_AWS

* Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed.

* Added tests and changed awssync.py to allow for testing the button_pressed function.

* Added get mailinglist to the awssync file

* Added first version of get_all_managers

* Added test case for mailing lists

* Removed some prints

* reformatted using black

* flake8 intentation added

* flake8 intentation correction

* Removed get manager

* Linting added

* unused import removed

* Added get_teamid_from_email

* Changed function email with teamid

* Updated get_emails_with_teamids, working now

* Added test for get_emails_with_ids

* Added linting

* linting

* Added more test

* Linting in awssync and its test file

* Moved the imports around

* moved the imports around

* Black linting

* switched imports around

* Switched imports around part 2

* Switched imports around part 3

* Switched imports around part 4

* Fixed when no project exist for mailing list

* Added some more tests

* Removed exeption try expect

* Black linting

* Changed get_email_with_teamid to new format

* Changed get_emails_with_teamids to go over project

* Added tests for get_emails_with_teamids

* changed info for get_emails_with_teamids

---------

Co-authored-by: Henk <hb130502@outlook.com>
* Added button to /admin/projects/project page on website

* Framework for AWS synchronisation button functionality

* Linked synchronisation button to framework

* Fixed import order to comply with flake8

* Added docstring to synchronise_to_AWS

* Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed.

* Added tests and changed awssync.py to allow for testing the button_pressed function.

* Added get mailinglist to the awssync file

* Added first version of get_all_managers

* Added test case for mailing lists

* Removed some prints

* reformatted using black

* flake8 intentation added

* flake8 intentation correction

* Removed get manager

* Linting added

* unused import removed

* Added get_teamid_from_email

* Changed function email with teamid

* Updated get_emails_with_teamids, working now

* Added test for get_emails_with_ids

* Added linting

* linting

* Added more test

* Linting in awssync and its test file

* Moved the imports around

* moved the imports around

* Black linting

* switched imports around

* Switched imports around part 2

* Switched imports around part 3

* Switched imports around part 4

* Fixed when no project exist for mailing list

* Added some more tests

* Removed exeption try expect

* Black linting

* Changed get_email_with_teamid to new format

* Changed get_emails_with_teamids to go over project

* Added tests for get_emails_with_teamids

* changed info for get_emails_with_teamids

* Changed email data dict to struct

* added test for TypeError exception for eq operator

* resolved linting errors

* changed comment to correct datatype

* dramatically improved test class name

---------

Co-authored-by: Henk <hb130502@outlook.com>
Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com>
Co-authored-by: Jer111 <j.vanoort7@gmail.com>
…ync button is pressed (#23)

* Added 'generate_aws_sync_list' function and tests

* solved black errors

* changed generate_aws_sync_list to use SyncData structure
* Add functions for creating and attaching SCP policies

* Improve test cases
* merged with development and added create_c_i_OU

* Added some tests for create_c_i_OU

* Added some tests for create_c_i_ou

* Linting

* Changed the mock_api call back to orginal

* Added create_team_ou with tests

* Fix problems with moto testing

* Worked on tests and added apitalkerclass

* Make test asserts  more meaningful

* black

* Added tests for create_ou's without parts

* Added one test that gets all children under OU

* Fix linting

* Changed return of response

create team ou did not save the name of the team OU

* Fix test create team OU

* Resolved linting issues

* Fix flake8

* remove create_team_ou

---------

Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com>
Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com>
* added double user check (partly)

* added some checks and made two new fancy classes for the storage of AWS tree dictionaries

* added tests

* added equals for AWSTree and Iteration objects

* test stupid error

* does it work now?

* resolved merge conflicts with rebasing on development

* cleaned up code based on pull request comments
* Added function for extracting data

* Added mock format

* finished function (testing needed)

* Linting fix

* fix no return of tree

* Fix AttributeError

* Unwrap tuple instead of accessing by element to increase code readability

* Fixed for new struct

* Implementation bug fixes

* added tests  (not done)

* Removed classes for merge

* Added function for extracting data

* Added mock format

* finished function (testing needed)

* Linting fix

* fix no return of tree

* Fix AttributeError

* Unwrap tuple instead of accessing by element to increase code readability

* Fixed for new struct

* Implementation bug fixes

* added tests  (not done)

* Linting fix

* git fixes

* Black fix

* pydocstyle fix

* Black fix again

* removed flake8 'fix'

* Final flake8 fix

* Final final flake8 fix

* spelling error fix

---------

Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com>
* Create and attach SCP policies (#29)

* Add functions for creating and attaching SCP policies

* Improve test cases

* Add function template

* Fix 'a/an' grammar mistake

* Add pipeline preconditions

* Add pipeline preconditions tests

* Add checks for required API actions

* Add test cases for checking required API actions

* Added implementation of creating and attaching policy in the pipeline

* Remove double API actions

* Added implementation of creating and moving accounts in the pipeline. This should still be divided into smaller functions.

* Increase code readability

* Stop checking account request status after known failure

* Fixed small typos and added account details to a debug message about account creation failure

* Added tests for pipeline policy and fixed typos in debug messages.

* Split creating and moving accounts into multiple functions, and handle exceptions

* added update_course_itation_ou with tests

* updated pipeline_update_current_course_iteration

* Add test cases for creating and moving member accounts

* Bug fixes for pipeline dependencies that arose from integration sprint 2 tasks

* Revised pipeline policy function and corresponding tests so that it should not fail after first pipeline run

* Change duplicate policy attachment to soft-fail; replace organization ID with root ID

---------

Co-authored-by: Henk <hb130502@outlook.com>
Co-authored-by: Jer111 <j.vanoort7@gmail.com>
* AWS synchronisation button (#8)

* Added button to /admin/projects/project page on website

* Framework for AWS synchronisation button functionality

* Linked synchronisation button to framework

* Fixed import order to comply with flake8

* Added docstring to synchronise_to_AWS

* Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed.

* Added tests and changed awssync.py to allow for testing the button_pressed function.

* Removed unnecessary docstrings.

* Add boto3 and moto dependencies (#11)

* Add logger and replace prints with logs

* Add function to create AWS organization

* Add unit tests for creating AWS organization

* bugfix (GiPHouse#619)

Co-authored-by: nvoers <nick-vanoers@hotmail.com>

* Added logger setlevel (#20)

* Db sync (#16)

* Added button to /admin/projects/project page on website

* Framework for AWS synchronisation button functionality

* Linked synchronisation button to framework

* Fixed import order to comply with flake8

* Added docstring to synchronise_to_AWS

* Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed.

* Added tests and changed awssync.py to allow for testing the button_pressed function.

* Added get mailinglist to the awssync file

* Added first version of get_all_managers

* Added test case for mailing lists

* Removed some prints

* reformatted using black

* flake8 intentation added

* flake8 intentation correction

* Removed get manager

* Linting added

* unused import removed

* Added get_teamid_from_email

* Changed function email with teamid

* Updated get_emails_with_teamids, working now

* Added test for get_emails_with_ids

* Added linting

* linting

* Added more test

* Linting in awssync and its test file

* Moved the imports around

* moved the imports around

* Black linting

* switched imports around

* Switched imports around part 2

* Switched imports around part 3

* Switched imports around part 4

* Fixed when no project exist for mailing list

* Added some more tests

* Removed exeption try expect

* Black linting

* Changed get_email_with_teamid to new format

* Changed get_emails_with_teamids to go over project

* Added tests for get_emails_with_teamids

* changed info for get_emails_with_teamids

---------

Co-authored-by: Henk <hb130502@outlook.com>

* Db sync (#25)

* Added button to /admin/projects/project page on website

* Framework for AWS synchronisation button functionality

* Linked synchronisation button to framework

* Fixed import order to comply with flake8

* Added docstring to synchronise_to_AWS

* Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed.

* Added tests and changed awssync.py to allow for testing the button_pressed function.

* Added get mailinglist to the awssync file

* Added first version of get_all_managers

* Added test case for mailing lists

* Removed some prints

* reformatted using black

* flake8 intentation added

* flake8 intentation correction

* Removed get manager

* Linting added

* unused import removed

* Added get_teamid_from_email

* Changed function email with teamid

* Updated get_emails_with_teamids, working now

* Added test for get_emails_with_ids

* Added linting

* linting

* Added more test

* Linting in awssync and its test file

* Moved the imports around

* moved the imports around

* Black linting

* switched imports around

* Switched imports around part 2

* Switched imports around part 3

* Switched imports around part 4

* Fixed when no project exist for mailing list

* Added some more tests

* Removed exeption try expect

* Black linting

* Changed get_email_with_teamid to new format

* Changed get_emails_with_teamids to go over project

* Added tests for get_emails_with_teamids

* changed info for get_emails_with_teamids

* Changed email data dict to struct

* added test for TypeError exception for eq operator

* resolved linting errors

* changed comment to correct datatype

* dramatically improved test class name

---------

Co-authored-by: Henk <hb130502@outlook.com>
Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com>
Co-authored-by: Jer111 <j.vanoort7@gmail.com>

* Added function to generate which users have to be invited after the sync button is pressed (#23)

* Added 'generate_aws_sync_list' function and tests

* solved black errors

* changed generate_aws_sync_list to use SyncData structure

* Create and attach SCP policies (#29)

* Add functions for creating and attaching SCP policies

* Improve test cases

* 12 moto helper (#36)

* merged with development and added create_c_i_OU

* Added some tests for create_c_i_OU

* Added some tests for create_c_i_ou

* Linting

* Changed the mock_api call back to orginal

* Added create_team_ou with tests

* Fix problems with moto testing

* Worked on tests and added apitalkerclass

* Make test asserts  more meaningful

* black

* Added tests for create_ou's without parts

* Added one test that gets all children under OU

* Fix linting

* Changed return of response

create team ou did not save the name of the team OU

* Fix test create team OU

* Resolved linting issues

* Fix flake8

* remove create_team_ou

---------

Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com>
Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com>

* Add checks for edge cases between AWS and Giphouse databases (#37)

* added double user check (partly)

* added some checks and made two new fancy classes for the storage of AWS tree dictionaries

* added tests

* added equals for AWSTree and Iteration objects

* test stupid error

* does it work now?

* resolved merge conflicts with rebasing on development

* cleaned up code based on pull request comments

* Extraction of AWS data

* Added function for extracting data

* Added mock format

* finished function (testing needed)

* Linting fix

* fix no return of tree

* Fix AttributeError

* Unwrap tuple instead of accessing by element to increase code readability

* Fixed for new struct

* Implementation bug fixes

* added tests  (not done)

* Removed classes for merge

* Added function for extracting data

* Added mock format

* finished function (testing needed)

* Linting fix

* fix no return of tree

* Fix AttributeError

* Unwrap tuple instead of accessing by element to increase code readability

* Fixed for new struct

* Implementation bug fixes

* added tests  (not done)

* Linting fix

* git fixes

* Black fix

* pydocstyle fix

* Black fix again

* removed flake8 'fix'

* Final flake8 fix

* Final final flake8 fix

* spelling error fix

---------

Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com>

* AWS synchronization pipeline (and integration bug fixes) (#42)

* Create and attach SCP policies (#29)

* Add functions for creating and attaching SCP policies

* Improve test cases

* Add function template

* Fix 'a/an' grammar mistake

* Add pipeline preconditions

* Add pipeline preconditions tests

* Add checks for required API actions

* Add test cases for checking required API actions

* Added implementation of creating and attaching policy in the pipeline

* Remove double API actions

* Added implementation of creating and moving accounts in the pipeline. This should still be divided into smaller functions.

* Increase code readability

* Stop checking account request status after known failure

* Fixed small typos and added account details to a debug message about account creation failure

* Added tests for pipeline policy and fixed typos in debug messages.

* Split creating and moving accounts into multiple functions, and handle exceptions

* added update_course_itation_ou with tests

* updated pipeline_update_current_course_iteration

* Add test cases for creating and moving member accounts

* Bug fixes for pipeline dependencies that arose from integration sprint 2 tasks

* Revised pipeline policy function and corresponding tests so that it should not fail after first pipeline run

* Change duplicate policy attachment to soft-fail; replace organization ID with root ID

---------

Co-authored-by: Henk <hb130502@outlook.com>
Co-authored-by: Jer111 <j.vanoort7@gmail.com>

---------

Co-authored-by: Henk Berendsen <61596108+hb140502@users.noreply.github.com>
Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com>
Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com>
Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com>
Co-authored-by: nvoers <nick-vanoers@hotmail.com>
Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com>
Co-authored-by: Henk <hb130502@outlook.com>
Co-authored-by: mitchellboes <49476235+mitchellboes@users.noreply.github.com>
Co-authored-by: Jer111 <j.vanoort7@gmail.com>
Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com>
* Separate AWS helper data structures into a dedicated module

* Fix asserts for exceptions in tests

* Add missing type hinting

* Replace str calls with repr
* Updated deliverable sprint 1 (#22)

* AWS synchronisation button (#8)

* Added button to /admin/projects/project page on website

* Framework for AWS synchronisation button functionality

* Linked synchronisation button to framework

* Fixed import order to comply with flake8

* Added docstring to synchronise_to_AWS

* Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed.

* Added tests and changed awssync.py to allow for testing the button_pressed function.

* Removed unnecessary docstrings.

* Add boto3 and moto dependencies (#11)

* Add logger and replace prints with logs

* Add function to create AWS organization

* Add unit tests for creating AWS organization

* bugfix (GiPHouse#619)

Co-authored-by: nvoers <nick-vanoers@hotmail.com>

* Added logger setlevel (#20)

---------

Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com>
Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com>
Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com>
Co-authored-by: nvoers <nick-vanoers@hotmail.com>
Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com>

* Sprint 2 deliverable (#43)

* AWS synchronisation button (#8)

* Added button to /admin/projects/project page on website

* Framework for AWS synchronisation button functionality

* Linked synchronisation button to framework

* Fixed import order to comply with flake8

* Added docstring to synchronise_to_AWS

* Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed.

* Added tests and changed awssync.py to allow for testing the button_pressed function.

* Removed unnecessary docstrings.

* Add boto3 and moto dependencies (#11)

* Add logger and replace prints with logs

* Add function to create AWS organization

* Add unit tests for creating AWS organization

* bugfix (GiPHouse#619)

Co-authored-by: nvoers <nick-vanoers@hotmail.com>

* Added logger setlevel (#20)

* Db sync (#16)

* Added button to /admin/projects/project page on website

* Framework for AWS synchronisation button functionality

* Linked synchronisation button to framework

* Fixed import order to comply with flake8

* Added docstring to synchronise_to_AWS

* Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed.

* Added tests and changed awssync.py to allow for testing the button_pressed function.

* Added get mailinglist to the awssync file

* Added first version of get_all_managers

* Added test case for mailing lists

* Removed some prints

* reformatted using black

* flake8 intentation added

* flake8 intentation correction

* Removed get manager

* Linting added

* unused import removed

* Added get_teamid_from_email

* Changed function email with teamid

* Updated get_emails_with_teamids, working now

* Added test for get_emails_with_ids

* Added linting

* linting

* Added more test

* Linting in awssync and its test file

* Moved the imports around

* moved the imports around

* Black linting

* switched imports around

* Switched imports around part 2

* Switched imports around part 3

* Switched imports around part 4

* Fixed when no project exist for mailing list

* Added some more tests

* Removed exeption try expect

* Black linting

* Changed get_email_with_teamid to new format

* Changed get_emails_with_teamids to go over project

* Added tests for get_emails_with_teamids

* changed info for get_emails_with_teamids

---------

Co-authored-by: Henk <hb130502@outlook.com>

* Db sync (#25)

* Added button to /admin/projects/project page on website

* Framework for AWS synchronisation button functionality

* Linked synchronisation button to framework

* Fixed import order to comply with flake8

* Added docstring to synchronise_to_AWS

* Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed.

* Added tests and changed awssync.py to allow for testing the button_pressed function.

* Added get mailinglist to the awssync file

* Added first version of get_all_managers

* Added test case for mailing lists

* Removed some prints

* reformatted using black

* flake8 intentation added

* flake8 intentation correction

* Removed get manager

* Linting added

* unused import removed

* Added get_teamid_from_email

* Changed function email with teamid

* Updated get_emails_with_teamids, working now

* Added test for get_emails_with_ids

* Added linting

* linting

* Added more test

* Linting in awssync and its test file

* Moved the imports around

* moved the imports around

* Black linting

* switched imports around

* Switched imports around part 2

* Switched imports around part 3

* Switched imports around part 4

* Fixed when no project exist for mailing list

* Added some more tests

* Removed exeption try expect

* Black linting

* Changed get_email_with_teamid to new format

* Changed get_emails_with_teamids to go over project

* Added tests for get_emails_with_teamids

* changed info for get_emails_with_teamids

* Changed email data dict to struct

* added test for TypeError exception for eq operator

* resolved linting errors

* changed comment to correct datatype

* dramatically improved test class name

---------

Co-authored-by: Henk <hb130502@outlook.com>
Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com>
Co-authored-by: Jer111 <j.vanoort7@gmail.com>

* Added function to generate which users have to be invited after the sync button is pressed (#23)

* Added 'generate_aws_sync_list' function and tests

* solved black errors

* changed generate_aws_sync_list to use SyncData structure

* Create and attach SCP policies (#29)

* Add functions for creating and attaching SCP policies

* Improve test cases

* 12 moto helper (#36)

* merged with development and added create_c_i_OU

* Added some tests for create_c_i_OU

* Added some tests for create_c_i_ou

* Linting

* Changed the mock_api call back to orginal

* Added create_team_ou with tests

* Fix problems with moto testing

* Worked on tests and added apitalkerclass

* Make test asserts  more meaningful

* black

* Added tests for create_ou's without parts

* Added one test that gets all children under OU

* Fix linting

* Changed return of response

create team ou did not save the name of the team OU

* Fix test create team OU

* Resolved linting issues

* Fix flake8

* remove create_team_ou

---------

Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com>
Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com>

* Add checks for edge cases between AWS and Giphouse databases (#37)

* added double user check (partly)

* added some checks and made two new fancy classes for the storage of AWS tree dictionaries

* added tests

* added equals for AWSTree and Iteration objects

* test stupid error

* does it work now?

* resolved merge conflicts with rebasing on development

* cleaned up code based on pull request comments

* Extraction of AWS data

* Added function for extracting data

* Added mock format

* finished function (testing needed)

* Linting fix

* fix no return of tree

* Fix AttributeError

* Unwrap tuple instead of accessing by element to increase code readability

* Fixed for new struct

* Implementation bug fixes

* added tests  (not done)

* Removed classes for merge

* Added function for extracting data

* Added mock format

* finished function (testing needed)

* Linting fix

* fix no return of tree

* Fix AttributeError

* Unwrap tuple instead of accessing by element to increase code readability

* Fixed for new struct

* Implementation bug fixes

* added tests  (not done)

* Linting fix

* git fixes

* Black fix

* pydocstyle fix

* Black fix again

* removed flake8 'fix'

* Final flake8 fix

* Final final flake8 fix

* spelling error fix

---------

Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com>

* AWS synchronization pipeline (and integration bug fixes) (#42)

* Create and attach SCP policies (#29)

* Add functions for creating and attaching SCP policies

* Improve test cases

* Add function template

* Fix 'a/an' grammar mistake

* Add pipeline preconditions

* Add pipeline preconditions tests

* Add checks for required API actions

* Add test cases for checking required API actions

* Added implementation of creating and attaching policy in the pipeline

* Remove double API actions

* Added implementation of creating and moving accounts in the pipeline. This should still be divided into smaller functions.

* Increase code readability

* Stop checking account request status after known failure

* Fixed small typos and added account details to a debug message about account creation failure

* Added tests for pipeline policy and fixed typos in debug messages.

* Split creating and moving accounts into multiple functions, and handle exceptions

* added update_course_itation_ou with tests

* updated pipeline_update_current_course_iteration

* Add test cases for creating and moving member accounts

* Bug fixes for pipeline dependencies that arose from integration sprint 2 tasks

* Revised pipeline policy function and corresponding tests so that it should not fail after first pipeline run

* Change duplicate policy attachment to soft-fail; replace organization ID with root ID

---------

Co-authored-by: Henk <hb130502@outlook.com>
Co-authored-by: Jer111 <j.vanoort7@gmail.com>

---------

Co-authored-by: Henk Berendsen <61596108+hb140502@users.noreply.github.com>
Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com>
Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com>
Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com>
Co-authored-by: nvoers <nick-vanoers@hotmail.com>
Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com>
Co-authored-by: Henk <hb130502@outlook.com>
Co-authored-by: mitchellboes <49476235+mitchellboes@users.noreply.github.com>
Co-authored-by: Jer111 <j.vanoort7@gmail.com>
Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com>

* Added class for API calls and preliminary version of the tests

* Added final test for API talker class

* Changed folder structure to organize AWS-related files

* Fixed tests which failed due to not being mocked correctly

* Removed aws files which have been moved to different folders

* Fixed bug which caused mocking to not work

* Added version of the api talker test which attempts to fix the error in test_simulate_principal_policy

* Fix mocking issue

* Added three remaining API calls and a test for one of them (list_tags_for_resource). Also added a function in the tests which creates an organization and returns its ID to clean up the other tests a bit.

* Added function and test for list_roots API call

* Fixed review comments

* Fixed formatting issue in test_awssync.py and resolved review comment in test_awsapitalker.py

---------

Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com>
Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com>
Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com>
Co-authored-by: nvoers <nick-vanoers@hotmail.com>
Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com>
Co-authored-by: Filip Łysak <92109241+FilipLysak001@users.noreply.github.com>
Co-authored-by: mitchellboes <49476235+mitchellboes@users.noreply.github.com>
Co-authored-by: Jer111 <j.vanoort7@gmail.com>
Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com>
…) into development

* refactored only the necessary checks to other files, as well as their tests.

* made changes based on pull request
* Move all AWS files to dedicated AWS directory

* Add refactored pipeline preconditions

* Add coverage unit tests
* Add new refactored AWSSync class

* Refactored creating course OU and attaching policy

* Add coverage unit tests

* Add additional OU name check to unit test

* Replace deprecated unittest method alias

* Improve naming coverage unit tests

* Fix test to check name and ID for single OU instead of over possibly multiple OUs

* Remove not used logger

* Rename function to be more accurate in what it does
* Changed moto_client into self.api_talker.org_client

* Use class decorators for mocking instead of start and stop functions
* refactored files

* removed create_aws_org from refactored

* flake8

* Correct refactored functions

* Changed extract_aws_setup to be more elegant

* rm list_all_mailing_lists and update extract_aws

* Changed extract_aws

* black

* Changed extract_aws to get_values

* pydocstring

* pydocstring

* Black
* Changed comments

* Refactored create move

* Refractored create_account

* Changed test

* Added my functions

* Add api talker function for describe_create_account_status

* Deleted create_account function

* Added test

* Fix describe_create_account_status docstring

* Changed describe function

* Finished basic test

* Finished refactor create move

* Black formattting

* Duplicate code

* Finished refractor

---------

Co-authored-by: Henk <hb130502@outlook.com>
* Added aws policy field on admin page

* Added view paremeters for aws policies

* Added a '.' to satisfy linting

* Updated the AWS policy model

* Added get_current_policy_id function

* Satisfy docstring

* Added test for save function in AWSPolicy model

* Added test case for the save AWSPolicy model

* Added tags values in aws policies

* Updated test_get_policy_id

* Changed GiPHouse name and get_policy name
* Changed comments

* Refactored create move

* Refractored create_account

* Changed test

* Added my functions

* Add api talker function for describe_create_account_status

* Deleted create_account function

* Added test

* Fix describe_create_account_status docstring

* Changed describe function

* Finished basic test

* Create structure of refactored pipeline

* Finished refactor create move

* Black formattting

* Duplicate code

* Reorganize files and complete merge

* Refactor according to finished create_and_move_account, aws data extraction

* first attempt at printing an error box when something fails in the pipeline (functional but not too pretty).

* Hotfixes pipeline for working sprint 3 demo

* Add pipeline test cases

* Fix 100% code coverage

* Fix tests for error box in pipeline

* Added the current policy to the pipeline

* Add API talker function and test for untag_resource AWS API call

* Remove most debug messages when testing

* Rename awssync_refactored to awssync

* Increase sleep time between requesting account info

* Implement pull request feedback

---------

Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com>
Co-authored-by: Henk <hb130502@outlook.com>
Co-authored-by: Mitchell <boesveld.mitchell@gmail.com>
Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com>
Fiflakos and others added 6 commits June 6, 2023 11:23
* Add initial draft AWS integration documentation

* Add pipeline flowchart and remove create organization

* Apply review changes
* Disable all logging output when running tests

* Add additional logging messages

* Reduce testing account request interval

* Remove redundant member account tags

* Remove redundant logging message and variable

* Add function retrieving the AWS policy tag from admin panel

* Change global account counter attributes to local

* Make base OU ID configurable in admin panel

* Fixed spacing between GitHub and AWS sync buttons

* Replace hard-coded security tags to retrieved from admin panel

* Incorporate security flaw tag into create_move_account tests

---------

Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com>
* added AWS deployment instructions to README

* corrected typo

* added part about base OU id

* Add info configurable base

* Change configuration instructions to be concise and complete

* Replace old incorrect reference

* Fix spelling mistake

* Add info about new account request interval and attempts

---------

Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com>
@1058274
Copy link
Contributor Author

1058274 commented Jun 10, 2023

See #624 for new mergeable PR that has been rebased on top of Website/main and with clean Django migration files.

@1058274 1058274 closed this Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants