Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING CHANGE: Identity and Resource Refactor and Update - Squash Commit #37

Open
wants to merge 5 commits into
base: prerelease
Choose a base branch
from

Conversation

ZanattaMichael
Copy link

@ZanattaMichael ZanattaMichael commented Oct 20, 2024

Pull Request (PR) description

The following pull request performs a major rework of the identity and resources of the module.

  1. Re-Working the caching mechanism to focus on enumeration and caching at the execution of the script.
  2. Removal of PAT Tokens from Resources.
  3. Removal of Api URL's from Resources.
  4. Rework of authentication and separating it into it's own command: New-AzDoAuthenticationProvider
  5. Introduction of Token retrieval protections to prevent accidental token pipeline leakage.
  6. Added the following resources:
    1. AzDevOpsProjectGroup
    2. AzDevOpsOrganizationGroup
    3. AzDevOpsGroupMember
    4. AzDoGroupPermission - Disabled
    5. AzDoProjectServices
    6. AzDoGitRepository
    7. AzDoGitPermission
  7. Renamed resource: AzDevOpsProject to xAzDevOpsProject

Task list

This Pull Request is currently in draft form and will be updated as more resources and features are added.

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Resource documentation updated in the resource's README.md.
  • Resource parameter descriptions updated in schema.mof.
  • Comment-based help updated, including parameter descriptions.
  • Localization strings updated.
  • Examples updated.
  • Unit tests updated. See DSC Community Testing Guidelines.
  • Integration tests updated (where possible). See DSC Community Testing Guidelines.
  • Code changes adheres to DSC Community Style Guidelines.

This change is Reviewable

ZanattaMichael and others added 3 commits January 17, 2024 13:00
Co-authored-by: Michael Zanatta <[email protected]>
* Adding Initial Class

* Creating ManagedIdentityToken class.
Expanding ManagedIdentityClass
Updated Invoke-AZDevOpsAPIRestMethod with ManagedIdentity Handeler

* Refactoring 004.AzManagedIdentity into Functions
Added APIRateLimit Enum

* Renaming DataResources
Updating AzureDevOpsDsc.Common.psd1
Initial ompleted Managed Identity Cmdlets.

* Adding Initial Tests

* Fixing Documentation
Adding Unit Tests

* Moving Tests
Completed ManagedIdentityToken Test

* Completed APIRateLimit Unit Testing

* Bug Fixes on Azure VM to get Managed Identity Working

* Updating Tests

* Fixing Tests

* Test Updates

* Updating Paths

* Update Paths

* Bug fixes with build and testing process

* Fixing Headers

* Bug Fixes with the Token

* Bug Fixes

* More bug fixes

* Fixing Bugs

* Updated Documentation and ChangeLog to bring into line with guidelines.

---------

Co-authored-by: Michael Zanatta <[email protected]>
* Finished Testing Set Method

* Update Add Resource

* Adding Debugging for New-AzDoOrgGroup

* Added Remove-xAzDoOrganizationGroup
Added Add-xAzDoOrganizationGroup

* Adding AzDoProject* Group

* Fixing Bugs

* Renaming Files

* Daily Commit

* Revert Export Cache Object

* Prep work to finish LCM

* Refactor Logic for LCM

* Add DscPlaybook
Refactor Code within LCM into Playbook
Updated logic to include DependsOn

* Adding Datum Compiling Configuration and Modules

* Add Configuration

* Adding baseline

* Rename Fix Bugs with Datum Lookups

* Update Configuration

* Refactored Configuration and Updated Merge Config

* Start work on build

* Refactoring Logic
Adding Verbose Logging

* Code Refactor

* Update GitIgnore
Update Configuration

* Fixed Logic Bug with Ensure:Absent

* Fixed Logic Bug with Ensure Absent

* Removing Debugging Code

* Bug Fixes

* Update

* Removing Endpoint Configuration

* Renaming Caching Functions

* Rename Functions

* Update Module Manifest

* Adding Group Member

* Adding top level tests

* Archiving Tests
Updating Tests

* Adding Tests
Sorting Tests

* Adding Cachine Tests

* Add Cache

* Adding Cache Test Initialization

* Reorganizing Tests

* Commenced Work of Adding GroupMembers Resource
Refactor of existing caching resource to preference groups prior to membership

* Adding Usercache and GroupMembership Cache

* Adding Logic to dertmine if the group needs to be modified.

* Bug Fixes

* Bug fixes with Caching

* Rename Functions

* Clearing Work on AzDoGroupMember

* Renamed files

* Bug Fixes

* Adding Format-AzDoProjectName
Adding Unit Tests

* Bug Fix

* Perform Code Cleanup
Fixed code for xAzDoGroupMember resource

* Accidently removed CLIXML Export

* Renamed file
Added Add-xAxDoGroupMember
Renamed: Format-UserPrincipalName  to Format-AzDoGroup

* Added New-DevOpsGroupMember
Renamed: Format-UserPrincipalName to Format-AzDoGroup

* Daily Commit

* Bug Fixes
Adding Verbose Logging
Daily Commit

* Bug Fixes with Searching for Display Name

* Add Remove-xAzDoGroupMember

* Daily Commit
Refactoring Authentication Logic to include differnt auth types

* Updated ResourceObject to load caching settings.
Added SecureString support for PAT Tokens
Bug Fixes
Fixing Plumbing issues with functions

* Performing Code Cleanup

* Code Refactor
Bug Fixes

* Daily Commit
Bug Fixes

* Daily Commit
Bug Fixes

* Daily Commit

* Added Initial Logic

* Adding wrapping logic to complete the set function

* Bugs Fixes

* Bug Fixes

* Remove ValidateSet with ValidateScript removing duplicate arrays
Move API Functions into Resources directories rather then using Verb.

* Cache Cleanup
Adding GitRepositoryCache Enumeratoion

* Added GitRepository Resource

* Bug Fixes

* Bug Fixes

* Adding Permission Classes and descriptor types

* Adding Permission Classes

* Adding Class Method Files

* Daily Commit

* Daily Commit

* Daily Commit

* Daily Commit

* Daily Commit

* Daily Commit

* Completed Initial ACLS resolution

* Daily Commit

* Bug Fixes

* Daily Commit

* Daily Commit

* Daily Commit
Bug Fixes

* Daily Commit

* Code cleanup

* Daily Commit
Added Compare-ACL function
Commenced Initial Testing

* Bug Fixes

* Daily Commit

* Adding TODO

* Daily Commit

* Daily Commit

* Renamed Files
Updated Test-ACLListForChanges

* Renamed Functions and Performed Code Cleanup

* Bug Fixes

* Bug Fixes with Caching

* Daily Commit

* Bug Fixes

* Bug Fixes
File Movement

* Disabling Logging

* Bug Fixes

* Bug Fixes

* Bug Fixes

* Removing Enums - Not required

* File cleanup. Remove redundent files.

* File Cleanup

* Code Cleanup. Recreating Tests

* Adding Authentication Unit Testing

* Adding Tests

* Adding Additional Tests

* Removing Unused Enums
Removing Permissions.ps1

* Adding AI Tests

* Adding Unit Tests

* Formatting cleanup for tests.

* Renaming Files to make place for new resources

* Adding xAzDoProjectGroupPermission

* Daily Commit

* Daily Commit

* Refactored ACL logic

* Adding xAzDoProjectGroupPermission

* Bug Fixes

* Adding Documentation

* Bug Fixes

* Bug Fixes

* Daily Commit

* Bug Fixes
Adding New Resource: xAzDoGroupPermission

* Adding Tests

* Adding Automated Testing

* Bug Fixes and Renaming Functions
Correcting File Names

* Bug Fixes

* Removing unused tests.
Writing a parameterized Initialization Script for intergration testing.

* Adding xAzDevOpsProjectServices resource

* Renamed Files

* Bug Fixes with AZDOProjectServices.

* Refactor of DevOps Project to include new settings

* Adding documentation

* Bug Fixes with Project Resource. More work is required.

* Bug Fixes

* Disabling Logging

* Adding ProjectAbbreviation
Bug Fixes with xAzDoProject Resource

* Remove ProjectAbbreviation

* Bug fixes with Description

* Fixed Bug with inherited flat within ACL check
Added additional logging

* Bug Fixes with GroupMembers
Starting work fixing issues with GroupMembers.

* Fixed caching bug with Set-xAzDoGroupMember when running Local Configuration Manager (LCM) twice.

* Fixing Spelling Issue
Adding Resource Documentation

* Adding More Documentation

* Adding More Documentation

* Bug fixes with Test method within LCM

* Adding Todo's

* Remove Export Clixml
TypeCast ReferanceACLs as Array
Adding Refresh-Cache Identity to fix bug with creating and setting group permissions in the same LCM run.

* Adding Documentation

* Adding Documentation

* Adding Documentation

* Renaming Directories
Updating Documentation

* Updating Documentation

* Adding Documentation

* Updating Documentation

* Updating Documentation

* Daily Commit

* Adjusting Logic for Test Framework

* Adding Unit Tests

* Update tests

* Adding Intergration Tests
Removing ProcessPermission Resource (not needed)

* Adding Initial Intergration Tests

* Bug Fixes with Intergration Testing

* Bug Fixes

* Remove -Verbose logging
Fixed bug in Get-xAzDoProject with blank description

* Moving untested intergrating tests.
Bug fixes.
Enabled logging for write-verbose.

* Bug Fixes

* Bug Fixes

* Update Logging
Moving Files

* Updating Documentation

* Big Fixes

* Adding New Tests
Removing Bugs

* Bug Fixes
Adding Logging
Completed Intergration Testing

* Bug Fixes

* Finish Testing

* Bug Fixes with DSCGetSummary State
Fixed Bug with Invoke-Tests

* Bug Fixes
Disabling Group Permission Resource

* Enabled All Tests
Fixed bugs with teardown logic

* Bug Fixes

* Starting unit tests
Reworking unit tests

* Adding CommonTestFunctions Module
Updating Tests to support CommonTestFunctions Module

* Adding Tests
Daily Commit

* Adding -ParameterFilter

* Adding Unit Tests for Cache

* Adding GitRepo Tests

* Fixing More Tests

* Update Project Tests

* Project Services

* Adding Security Descriptor

* Updating Tests

* Adding Managed Identity Token Tests
More work is needed

* Bug Fixes
Adding Authentication Tests

* Bug Fixes with Tests

* Adding Cache Tests

* Adding Tests

* Initialize-CacheObject

* Adding Unit Tests

* Add ProjectCache

* Adding GroupCache

* Adding Cache

* Bug Fixes

* Bug Fixes

* Adding Tests

* Adding Tests

* Bug Fixes with Tests

* Reformat Tests

* Test Fixes

* Rename File

* Rename Files

* Bug Fixes
Adding Tests

* Finishing Tests
Adding Tags

* Adding Test Tags

* Bug Fixes
Updating Tests

* Bug Fixes
Adding Tests

* Bug Fixes
Adding Tests

* Bug Fixes with Test

* Bug Fixes

* Disabling Tests

* Disabling Archived Tests

* Renaming Files

* Bug Fixes
Fixing Spelling

* Rename File

* Daily Commit

* Completed initial tests for xAzDoGitPermission

* Bug Fixes
Adding xAzDoGitRepository

* Rename files
Bug Fixes

* Adding tests

* Adding Tests to xAzDoGroupPermission

* Adding xAzDoOrganizationGroup

* Remove Wait-Debugger

* Add AzDoProject Tests

* Bug Fixes

* Bug Fixes

* Bug Fixes

* Fixed bug within Find-Identity
Disabling Unused Tests
Adding additional Verbose logging

* Fixed bug with caching after creating git repository

* Adding: Refresh-AzDoCache
Adding Logging
Fixed bug where identities are being added to the wrong cache
Replaced AzDOAPI_0_ProjectCache / Refresh-AzDoCache

* Add MI support for Azure Arc

* Bug Fixes with Azure Arc Authentication

* Add MI support for Azure Arc

* Bug Fixes with Azure Arc Authentication

---------

Co-authored-by: Michael Zanatta <[email protected]>
Co-authored-by: david <[email protected]>
@ZanattaMichael
Copy link
Author

Based off #36

* Updated Classes to be in-line with DSC Coding Guidelines

Removed 'x' from xAzDoGitPermission

* Removed 'x' from xAzDoGitRepository.

* Remove 'x' from xAzDoGroupMember

* Removed 'x' from xAzDoGroupPermission

* Removed 'x' from xAzDoOrganizationGroup

* Removed 'x' from xAzDoProject

* Removed 'x' from Resource

* Removed 'x' from Resources

* Adding Documentation

* Performing Code Refactoring to Bring it into line with AZDO Coding Guidelines

* Please Implicit Mandatory Attribute with 'explicit'

* Adding Documentation
Fixing Issues

* Set Explicit Mandatory
Performing Code Refactoring

* Code Formatting

* Code Refactoring

* Update the Cache Initialization Scripts

* Code Cleanup of Cache

* Fixed String Formatting and Code Blocks in Private Functions

* Updating Codebase to support DSC Community Code Guidelines

* Code standard changes

---------

Co-authored-by: Michael Zanatta <[email protected]>
@kilasuit kilasuit self-requested a review October 22, 2024 02:00
@kilasuit kilasuit changed the base branch from main to prerelease October 24, 2024 08:07
* Remove 'x' from Files and Directories

* Added Common Testing to root of the repository
Updating Project Tasks

* Bug Fixes

* Bug Fixes within Tests
Updating Tests to be in-line with changes

* Code Cleanup of commontests script
Add New-AzDoAuthenticationProvider tests

* Big Fixes

* Bug Fixes with Tests
Adding Azure DevOps DSC Tests

* Adding Basline Mocking and Classes

* Adding Test Initalization Fixes
Fixes to Tests
More Work is required.

* Adding Tests
Renamed: Invoke-BeforeEachFunctions to: Get-FunctionItem

* Renamed: Find-Functions to Find-MockedFunctions

* Finishing Initial Testing
Removing Un-used Tests

* Bug Fixes to Bring in tests

* Fixed: AzDevOpsDscResourceBase tests

* Refactoring Tests

* Bug Fixes

* Bug Fixes with Tests

* Adding Tests

* Adding More tests
Bug Fixes

* Removing Archived Tests

* Bug Fixes
Updating Documentation

* Adding Documentation

* Adding excludedProjectsFromTeardown

* Running Intergration Tests
Fixing Bug with Test-isWindowsAdmin function
Fixing Intergration Supporting function bugs

* Removing Unsed Paths.
Fixing Tests

* Fixed Bug with Regex Matching
Added Unit Testing to provide code coverage

* Bug Fixes

* Bug Fixes with Intergration Tests
Fixed Bug with ResourceBase class
Fixed Bug with GetMembers using the wrong type

* Fixed Bug with Test-AzDoProject being the incorrect type
Fixed bug in Get-AzDoProject typecasting lookupresult
Fixed unchanged bug with Get-AzDoProject

* Bug Fixing Tests

---------

Co-authored-by: Michael Zanatta <[email protected]>
@ZanattaMichael
Copy link
Author

All sorry for the run around. I've reworked the module to be in line with the DSC Community standards and fixed a few bugs along the way. :-)

@ZanattaMichael ZanattaMichael marked this pull request as ready for review November 3, 2024 22:07
@kilasuit
Copy link
Contributor

kilasuit commented Nov 6, 2024

FYI - I've changed what branch this points to only due how much there is here that needs to be reviewed

Just to set expectations I am setting aside time to fully review on 11th November to look at this getting merged that day.

@ZanattaMichael
Copy link
Author

Sorry I thought I responded, but I didn't. That's fine. I'll be DMing that day, but I'll keep a close eye on this.

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.

2 participants