diff --git a/.gitignore b/.gitignore index 79f71f2..ece3e42 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ /.output /PSModules /.vscode -/Carbon.Permissions/CHANGELOG.md -/Carbon.Permissions/LICENSE.txt -/Carbon.Permissions/NOTICE.txt -/Carbon.Permissions/README.md -/Carbon.Permissions/Modules/ \ No newline at end of file +/Carbon.Security/CHANGELOG.md +/Carbon.Security/LICENSE.txt +/Carbon.Security/NOTICE.txt +/Carbon.Security/README.md +/Carbon.Security/Modules/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 36d05e9..df28624 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,12 @@ -# Carbon.Permissions Changelog +# Carbon.Security Changelog ## 1.0.0 ### Upgrade Instructions This is not the upgrade path you want, if switching from Carbon. The `Get-CPermission`, `Grant-CPermission`, -`Revoke-CPermission`, and `Test-CPermission` functions were migrated to the following modules with the following -function names. +`Revoke-CPermission`, and `Test-CPermission` functions were migrated to the following provider-specific modules with the +following function names: `Carbon.FileSystem`: @@ -31,52 +31,7 @@ function names. * `Revoke-CPrivateKeyPermission` * `Test-CPrivateKeyPath` -You *must* switch to `Carbon.Cryptography` if managing permissions on private keys/key containers. `Carbon.Permissions` -only manages permissions on files, directories, and registry keys. - -Replace usages of the `Grant-CPermission` and `Test-CPermission` functions' `ApplyTo` parameter with new parameter -values and a new `OnlyApplyToChildren` switch: - -| Old Parameters | New Parameters -| -------------------------------------------------- | -------------- -| -ApplyTo Container | -ApplyTo ContainerOnly -| -ApplyTo SubContainers | -ApplyTo SubcontainersOnly -| -ApplyTo Leaves | -ApplyTo LeavesOnly -| -ApplyTo ChildContainers | -ApplyTo SubcontainersOnly -OnlyApplyToChildren -| -ApplyTo ChildLeaves | -ApplyTo LeavesOnly -OnlyApplyToChildren -| -ApplyTo ContainerAndSubContainers | -ApplyTo ContainerAndSubcontainers -| -ApplyTo ContainerAndLeaves | -ApplyTo ContainerAndLeaves -| -ApplyTo SubContainerAndLeaves | -ApplyTo SubcontainersAndLeavesOnly -| -ApplyTo ContainerAndChildContainers | -ApplyTo ContainerAndSubcontainers -OnlyApplyToChildren -| -ApplyTo ContainerAndChildLeaves | -ApplyTo ContainerAndLeaves -OnlyApplyToChildren -| -ApplyTo ContainerAndChildContainersAndChildLeaves | -ApplyTo ContainerSubcontainersAndLeaves -OnlyApplyToChildren -| -ApplyTo ContainerAndSubContainersAndLeaves | -ApplyTo ContainerSubcontainersAndLeaves -| -ApplyTo ChildContainersAndChildLeaves | -ApplyTo SubcontainersAndLeavesOnly -OnlyApplyToChildren - -Replace usages of `Get-Permissions` with `Get-CPermission`. - -Replace usages of `Grant-Permissions` with `Grant-CPermission`. - -Rename usages of the `Get-CPermission` and `Test-CPermission` functions' `Exact` switch to `Strict`. - ### Added -* Function `Get-CPermission`, migrated from Carbon. -* Function `Grant-CPermission`, migrated from Carbon. -* Function `Revoke-CPermission`, migrated from Carbon. -* Function `Test-CPermission`, migrated from Carbon. * Function `Get-CAcl` to get the access control (i.e. security descriptor) for a registry key, file, or directory. -Supports getting only specific sections/parts of the security descriptor, too. - -### Changed - -* Switch `Exact` renamed to `Strict` on the `Get-CPermission` and `Test-CPermission` functions. - -### Removed - -* Alias `Get-Permissions`. Use `Get-CPermission` instead. -* Alias `Grant-Permissions`. Use `Grant-CPermission` instead. -* Private key/key container support from `Get-CPermission`, `Grant-CPermission`, `Revoke-CPermission`, and -`Test-CPermission`. Switch to the `Carbon.Cryptography` module's `Get-CPrivateKey`, `Get-CPrivateKeyPermission`, -`Grant-CPrivateKeyPermission`, `Resolve-CPrivateKeyPath`, `Revoke-CPrivateKeyPermission`, and `Test-CPrivateKeyPath` -instead. \ No newline at end of file +Supports getting only specific sections/parts of the security descriptor, too. Works across PowerShell editions. diff --git a/Carbon.Permissions/en-US/about_Carbon.Permissions.help.txt b/Carbon.Permissions/en-US/about_Carbon.Permissions.help.txt deleted file mode 100644 index 869a55f..0000000 --- a/Carbon.Permissions/en-US/about_Carbon.Permissions.help.txt +++ /dev/null @@ -1,38 +0,0 @@ -TOPIC - about_Carbon.Permissions - -SHORT DESCRIPTION - The "Carbon.Permissions" module manages permissions on files, directories, registry keys, and certificate private - keys/key containers. - -LONG DESCRIPTION - SYSTEM REQUIREMENTS - - * Windows PowerShell 5.1 and .NET 4.6.1+ - * PowerShell 7+ - - - INSTALLING - - To install globally: - - Install-Module -Name 'Carbon.Permissions' - Import-Module -Name 'Carbon.Permissions' - - To install privately: - - Save-Module -Name 'Carbon.Permissions' -Path '.' - Import-Module -Name '.\Carbon.Permissions' - - - COMMANDS - - * `Get-CAcl`: Gets the access control (i.e. security descriptor) for a file, directory, or registry key. - * `Get-CPermission`: Gets the permissions (access control rules) for a file, directory, registry key, or certificate - private key/key container. - * `Grant-CPermission`: Grants permissions on a file, directory, registry key, or certificate private key/key - container. - * `Revoke-CPermission`: Revokes permissions on a file, directory, registry key, or certificate private key/key - container. - * `Test-CPermission`: Tests permissions on a file, directory, registry key, or certificate private key/key - container. diff --git a/Carbon.Permissions/Carbon.Permissions.psd1 b/Carbon.Security/Carbon.Security.psd1 similarity index 82% rename from Carbon.Permissions/Carbon.Permissions.psd1 rename to Carbon.Security/Carbon.Security.psd1 index 0aef08d..713e953 100644 --- a/Carbon.Permissions/Carbon.Permissions.psd1 +++ b/Carbon.Security/Carbon.Security.psd1 @@ -15,7 +15,7 @@ @{ # Script module or binary module file associated with this manifest. - RootModule = 'Carbon.Permissions.psm1' + RootModule = 'Carbon.Security.psm1' # Version number of this module. ModuleVersion = '1.0.0' @@ -36,7 +36,7 @@ Copyright = '(c) WebMD Health Services.' # Description of the functionality provided by this module - Description = 'Managing file system, registry, and private key permissions.' + Description = 'Manages security.' # Minimum version of the Windows PowerShell engine required by this module PowerShellVersion = '5.1' @@ -101,23 +101,20 @@ # List of all files packaged with this module # FileList = @() - # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. + # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData + # hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ - # Tags applied to this module. These help with module discovery in online galleries. - Tags = @( - 'Desktop', 'Core', 'permission', 'accesscontrol', 'access', 'control', 'securitydescriptor', - 'security', 'descriptor', 'acl', 'file', 'directory', 'registry', 'acl', 'icacls', 'certificate', - 'crypto', 'key', 'cryptokey', 'cryptokeysecrurity', 'private', 'cng', 'privatekey', 'grant', 'revoke' - ) + # Tags applied to this module. We don't want people to find this module. + Tags = @( 'Desktop', 'Core', 'acl' ) # A URL to the license for this module. LicenseUri = 'http://www.apache.org/licenses/LICENSE-2.0' # A URL to the main website for this project. - ProjectUri = 'https://github.com/webmd-health-services/Carbon.Permissions' + ProjectUri = 'https://github.com/webmd-health-services/Carbon.Security' # A URL to an icon representing this module. # IconUri = '' @@ -125,7 +122,7 @@ Prerelease = '' # ReleaseNotes of this module - ReleaseNotes = 'https://github.com/webmd-health-services/Carbon.Permissions/blob/main/CHANGELOG.md' + ReleaseNotes = 'https://github.com/webmd-health-services/Carbon.Security/blob/main/CHANGELOG.md' } # End of PSData hashtable } # End of PrivateData hashtable diff --git a/Carbon.Permissions/Carbon.Permissions.psm1 b/Carbon.Security/Carbon.Security.psm1 similarity index 100% rename from Carbon.Permissions/Carbon.Permissions.psm1 rename to Carbon.Security/Carbon.Security.psm1 diff --git a/Carbon.Permissions/Functions/Get-CAcl.ps1 b/Carbon.Security/Functions/Get-CAcl.ps1 similarity index 100% rename from Carbon.Permissions/Functions/Get-CAcl.ps1 rename to Carbon.Security/Functions/Get-CAcl.ps1 diff --git a/Carbon.Permissions/Functions/Get-CPermission.ps1 b/Carbon.Security/Functions/Get-CPermission.ps1 similarity index 100% rename from Carbon.Permissions/Functions/Get-CPermission.ps1 rename to Carbon.Security/Functions/Get-CPermission.ps1 diff --git a/Carbon.Permissions/Functions/Grant-CPermission.ps1 b/Carbon.Security/Functions/Grant-CPermission.ps1 similarity index 100% rename from Carbon.Permissions/Functions/Grant-CPermission.ps1 rename to Carbon.Security/Functions/Grant-CPermission.ps1 diff --git a/Carbon.Permissions/Functions/Resolve-Arg.ps1 b/Carbon.Security/Functions/Resolve-Arg.ps1 similarity index 100% rename from Carbon.Permissions/Functions/Resolve-Arg.ps1 rename to Carbon.Security/Functions/Resolve-Arg.ps1 diff --git a/Carbon.Permissions/Functions/Revoke-CPermission.ps1 b/Carbon.Security/Functions/Revoke-CPermission.ps1 similarity index 100% rename from Carbon.Permissions/Functions/Revoke-CPermission.ps1 rename to Carbon.Security/Functions/Revoke-CPermission.ps1 diff --git a/Carbon.Permissions/Functions/Test-CPermission.ps1 b/Carbon.Security/Functions/Test-CPermission.ps1 similarity index 100% rename from Carbon.Permissions/Functions/Test-CPermission.ps1 rename to Carbon.Security/Functions/Test-CPermission.ps1 diff --git a/Carbon.Permissions/Functions/Use-CallerPreference.ps1 b/Carbon.Security/Functions/Use-CallerPreference.ps1 similarity index 100% rename from Carbon.Permissions/Functions/Use-CallerPreference.ps1 rename to Carbon.Security/Functions/Use-CallerPreference.ps1 diff --git a/Carbon.Security/en-US/about_Carbon.Permissions.help.txt b/Carbon.Security/en-US/about_Carbon.Permissions.help.txt new file mode 100644 index 0000000..912d16c --- /dev/null +++ b/Carbon.Security/en-US/about_Carbon.Permissions.help.txt @@ -0,0 +1,30 @@ +TOPIC + about_Carbon.Security + +SHORT DESCRIPTION + The "Carbon.Security" module has a `Get-CAcl` function that gets an item's ACL that works across PowerShell + editions. + +LONG DESCRIPTION + SYSTEM REQUIREMENTS + + * Windows PowerShell 5.1 and .NET 4.6.1+ + * PowerShell 7+ + + + INSTALLING + + To install globally: + + Install-Module -Name 'Carbon.Security' + Import-Module -Name 'Carbon.Security' + + To install privately: + + Save-Module -Name 'Carbon.Security' -Path '.' + Import-Module -Name '.\Carbon.Security' + + + COMMANDS + + * `Get-CAcl`: Gets the access control (i.e. security descriptor) for a file, directory, or registry key. diff --git a/Carbon.Permissions/prism.json b/Carbon.Security/prism.json similarity index 100% rename from Carbon.Permissions/prism.json rename to Carbon.Security/prism.json diff --git a/Carbon.Permissions/prism.lock.json b/Carbon.Security/prism.lock.json similarity index 100% rename from Carbon.Permissions/prism.lock.json rename to Carbon.Security/prism.lock.json diff --git a/NOTICE.txt b/NOTICE.txt index f1ecd8c..fdf0acd 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,4 +1,4 @@ -Carbon.Permissions +Carbon.Security Copyright 2023 WebMD Health Services diff --git a/README.md b/README.md index 89e6b03..355ee34 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ -# Carbon.Permissions PowerShell Module +# Carbon.Security PowerShell Module ## Overview -The "Carbon.Permissions" module manages permissions on files, directories, registry keys, and certificate private -keys/key containers. +The "Carbon.Security" module has a function get an ACLs that works across PowerShell editions. ## System Requirements @@ -19,23 +18,17 @@ keys/key containers. To install globally: ```powershell -Install-Module -Name 'Carbon.Permissions' -Import-Module -Name 'Carbon.Permissions' +Install-Module -Name 'Carbon.Security' +Import-Module -Name 'Carbon.Security' ``` To install privately: ```powershell -Save-Module -Name 'Carbon.Permissions' -Path '.' -Import-Module -Name '.\Carbon.Permissions' +Save-Module -Name 'Carbon.Security' -Path '.' +Import-Module -Name '.\Carbon.Security' ``` ## Commands * `Get-CAcl`: Gets the access control (i.e. security descriptor) for a file, directory, or registry key. -* `Get-CPermission`: Gets the permissions (access control rules) for a file, directory, registry key, or certificate - private key/key container. -* `Grant-CPermission`: Grants permissions on a file, directory, registry key, or certificate private key/key container. -* `Revoke-CPermission`: Revokes permissions on a file, directory, registry key, or certificate private key/key - container. -* `Test-CPermission`: Tests permissions on a file, directory, registry key, or certificate private key/key container. diff --git a/Tests/Carbon.Permissions.Tests.ps1 b/Tests/Carbon.Security.Tests.ps1 similarity index 84% rename from Tests/Carbon.Permissions.Tests.ps1 rename to Tests/Carbon.Security.Tests.ps1 index 6267acd..1c4a989 100644 --- a/Tests/Carbon.Permissions.Tests.ps1 +++ b/Tests/Carbon.Security.Tests.ps1 @@ -17,7 +17,7 @@ BeforeAll { ) $verbs = - Get-Command -Module 'Carbon.Permissions'| + Get-Command -Module 'Carbon.Security'| Where-Object { $_ -isnot [Management.Automation.AliasInfo] } | Select-Object -ExpandProperty Verb | Select-Object -Unique @@ -64,10 +64,10 @@ BeforeAll { } } -Describe 'Carbon.Permissions' { +Describe 'Carbon.Security' { It 'should have about help topic' { GivenModuleImported - ThenHelpTopic 'about_Carbon.Permissions' -Exists + ThenHelpTopic 'about_Carbon.Security' -Exists } It 'should only use approved verbs' { @@ -77,7 +77,7 @@ Describe 'Carbon.Permissions' { It 'should have a help topic for each command' { GivenModuleImported - foreach( $cmd in (Get-Command -Module 'Carbon.Permissions' -CommandType Function,Cmdlet,Filter)) + foreach( $cmd in (Get-Command -Module 'Carbon.Security' -CommandType Function,Cmdlet,Filter)) { ThenHelpTopic $cmd.Name -Exists -HasSynopsis -HasDescription -HasExamples } diff --git a/Tests/Carbon.PermissionsTestHelper/Carbon.PermissionsTestHelper.psm1 b/Tests/Carbon.SecurityTestHelper/Carbon.SecurityTestHelper.psm1 similarity index 100% rename from Tests/Carbon.PermissionsTestHelper/Carbon.PermissionsTestHelper.psm1 rename to Tests/Carbon.SecurityTestHelper/Carbon.SecurityTestHelper.psm1 diff --git a/Tests/Certificates/CarbonRsaCng.cer b/Tests/Certificates/CarbonRsaCng.cer deleted file mode 100644 index a6ec4fc..0000000 --- a/Tests/Certificates/CarbonRsaCng.cer +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN NEW CERTIFICATE REQUEST----- -MIIE2zCCAsOgAwIBAgIQI26HrbEZ9pZPLS+97Qw3KDANBgkqhkiG9w0BAQ0FADAX -MRUwEwYDVQQDDAxDYXJib25Sc2FDbmcwIBcNMjMwNTA1MTkxNDQ5WhgPOTk5OTEy -MzExOTI0NDhaMBcxFTATBgNVBAMMDENhcmJvblJzYUNuZzCCAiIwDQYJKoZIhvcN -AQEBBQADggIPADCCAgoCggIBALI2srWiasnbNaOCgml0nLj5FrzVA2gCqwYQjS2h -um/qjbeU5Z0PVAaGHNEZU7E3YxvCHOrBeN2whLUIDr2aWkcoI7eao97kCeetcyV/ -HdbYBjYlbakf3+YV+URy1G/sGiedYOiMZ4QN7rjssHw49bHb8y8ymo7koGtV0Kii -yhxLG+aj1G2jfLl9g7y+uep89tKTiUUNerWF0y90Upf171oN75+UJSr6rzAqf3J3 -4wLRKRP+5e09WohgqOTEvgR4ymrAFHDyU1GODOdLi+tP+4ZnUJEpvJ7NohpEUNvx -9/7q/lVn7B6lF/d9xqLtYfFtmh2yUemW0rRBtKSVmIMwKCl5qP7WU15FJ6Yg6X0z -6mMEtMyGfr+C5GfQ3/txqO2ArX5dd1hSkUIuKYriw0V2D3Sg3e2Msn7iy/2zTBam -olFErv99AqFLBtEQjtyStvKi9kcF6kKswbdF2LzYo0D5CR43w0R23edFUMQGYDXW -rX7ZqNt3zmVS49Fa/ZvIU97domjATOELafuS8ta82ZCy0bZAMw7S9/NgOx2QecEu -O9RInzYH+V8f7gprbSqNirzAVOpIPzTDTk9phiGwwqOyy8kMB7ZSKIPxYmjabyb6 -dvN6KwvTLkkLgl6vnJYAabeWQB50zQSarQXalkVX330VI4pOKlWuISy4nRdttdlu -h0gxAgMBAAGjITAfMB0GA1UdDgQWBBS2H/5rZAs10jqvjy3d5LvNUK0hGzANBgkq -hkiG9w0BAQ0FAAOCAgEAioj3IBeHdV42Z3QwwR4CpJkI5L5yKt04LKKOApjC0YXY -1/0tr14ws2MU7d8TQVdj0stT4q81oDqeOKKYccXef/qiu7uTlQWNmsr5xgumtwLe -0uNCh1GKkwn/+O0iU8tc/oS+JB4aLATnZvEWWIbpvNiYjwbodXzGvtOo3ioGJrkS -3RTBdngrbsnd9ygjyTz9jlm+dtcMtN36xaC9PQi0ma4ZFq8DogZSMOaFpWQdmimK -FdDFSTHb59Qix4QiQTHUU/QLin8KI4L5nJZtYR+hgNvy1FRLA3grtbzI3PRAhlic -N2OXKrtWFwfJoDiTZEYmnB/m5Dkti4cio+JhsZGdvcCh0/20WwPS0xArWMnuWKjF -r+GlJbO3sYa7Gyy/H2wSWRVatXJlNey7zqO2ZHYdWtzk10g7G3h4C6li0Qb9/btC -DQCszeVd5VDVyiO0G4aov7IvZbiTHqAFCdGZp+jtTdN8b5arrdCs9l6MNlOFG1/J -SCQIDX1gbyt1A9g9fWbquzQVvuFTyecMx8Wu+iwW0yKm3bALST3ZgAcQXiDUvlZr -/rb4Lr3bhXa16YF6qhElzPXqLHMEi1UbRaEZ+yjImYOnoYBoVEq/zmBZh99ztZRw -gjiyLRA+nEZSEmf60KKP4+pHDMUoXdS2CasunNDhKLpWxagWH9PZpsYnbDhD9yk= ------END NEW CERTIFICATE REQUEST----- diff --git a/Tests/Certificates/CarbonRsaCng.pfx b/Tests/Certificates/CarbonRsaCng.pfx deleted file mode 100644 index d71f04d..0000000 Binary files a/Tests/Certificates/CarbonRsaCng.pfx and /dev/null differ diff --git a/Tests/Certificates/CarbonTestPrivateKey.pfx b/Tests/Certificates/CarbonTestPrivateKey.pfx deleted file mode 100644 index 34b30fd..0000000 Binary files a/Tests/Certificates/CarbonTestPrivateKey.pfx and /dev/null differ diff --git a/Tests/Grant-CPermission.Tests.ps1 b/Tests/Grant-CPermission.Tests.ps1 index dff54ea..6360e8e 100644 --- a/Tests/Grant-CPermission.Tests.ps1 +++ b/Tests/Grant-CPermission.Tests.ps1 @@ -9,7 +9,7 @@ BeforeAll { & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-Test.ps1' -Resolve) - $psModulesSharedPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.Permissions\Modules' -Resolve + $psModulesSharedPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.Security\Modules' -Resolve Import-Module -Name (Join-Path -Path $psModulesSharedPath -ChildPath 'Carbon.Core' -Resolve) ` -Function ('Get-CPathProvider') ` -Global ` @@ -394,11 +394,11 @@ Describe 'Grant-CPermission' { Invoke-GrantPermissions -Identity $script:user -Permission FullControl -Path $containerPath ThenPermission -On $containerPath -For $script:user -Is ([FileSystemRights]::FullControl) - Mock -CommandName 'Set-Acl' -Verifiable -ModuleName 'Carbon.Permissions' + Mock -CommandName 'Set-Acl' -Verifiable -ModuleName 'Carbon.Security' Invoke-GrantPermissions -Identity $script:user -Permission FullControl -Path $containerPath ThenPermission -On $containerPath -For $script:user -Is ([FileSystemRights]::FullControl) - Should -Invoke 'Set-Acl' -Times 0 -ModuleName 'Carbon.Permissions' + Should -Invoke 'Set-Acl' -Times 0 -ModuleName 'Carbon.Security' } It 'when forcing a permission change and the user already has the permissions' { @@ -415,7 +415,7 @@ Describe 'Grant-CPermission' { -HasInheritanceFlags [InheritanceFlags]::ObjectInherit ` -HasPropagationFlags [PropagationFlags]::NoPropagateInherit - Mock -CommandName 'Set-Acl' -Verifiable -ModuleName 'Carbon.Permissions' + Mock -CommandName 'Set-Acl' -Verifiable -ModuleName 'Carbon.Security' Grant-CPermission -Identity $script:user ` -Permission FullControl ` @@ -423,7 +423,7 @@ Describe 'Grant-CPermission' { -ApplyTo ContainerAndLeaves ` -Force - Should -Invoke 'Set-Acl' -Times 1 -Exactly -ModuleName 'Carbon.Permissions' + Should -Invoke 'Set-Acl' -Times 1 -Exactly -ModuleName 'Carbon.Security' } It 'when an item is hidden' { diff --git a/Tests/Initialize-Test.ps1 b/Tests/Initialize-Test.ps1 index 66a24a7..436bb82 100644 --- a/Tests/Initialize-Test.ps1 +++ b/Tests/Initialize-Test.ps1 @@ -31,8 +31,8 @@ try Remove-Module -Name 'Carbon' -Force -ErrorAction Ignore $modules = [ordered]@{ - 'Carbon.Permissions' = '..\Carbon.Permissions'; - 'Carbon.PermissionsTestHelper' = 'Carbon.PermissionsTestHelper'; + 'Carbon.Security' = '..\Carbon.Security'; + 'Carbon.SecurityTestHelper' = 'Carbon.SecurityTestHelper'; } foreach( $moduleName in $modules.Keys ) { diff --git a/Tests/Revoke-CPermission.Tests.ps1 b/Tests/Revoke-CPermission.Tests.ps1 index 4eebb9e..61a5f90 100644 --- a/Tests/Revoke-CPermission.Tests.ps1 +++ b/Tests/Revoke-CPermission.Tests.ps1 @@ -27,11 +27,11 @@ Describe 'Revoke-CPermission' { It 'when user has multiple access control entries on an item' { Grant-CPermission -Path $script:testDirPath -Identity $script:username -Permission 'Read' $perm = Get-CPermission -Path $script:testDirPath -Identity $script:username - Mock -CommandName 'Get-CPermission' -ModuleName 'Carbon.Permissions' -MockWith { $perm ; $perm }.GetNewClosure() + Mock -CommandName 'Get-CPermission' -ModuleName 'Carbon.Security' -MockWith { $perm ; $perm }.GetNewClosure() $Global:Error.Clear() Revoke-CPermission -Path $script:testDirPath -Identity $script:username $Global:Error | Should -BeNullOrEmpty - Carbon.Permissions\Get-CPermission -Path $script:testDirPath -Identity $script:username | Should -BeNullOrEmpty + Carbon.Security\Get-CPermission -Path $script:testDirPath -Identity $script:username | Should -BeNullOrEmpty } It 'should revoke permission' { diff --git a/init.ps1 b/init.ps1 index f60a1c7..e399e91 100644 --- a/init.ps1 +++ b/init.ps1 @@ -1,10 +1,10 @@ <# .SYNOPSIS -Gets your computer ready to develop the Carbon.Permissions module. +Gets your computer ready to develop the Carbon.Security module. .DESCRIPTION The init.ps1 script makes the configuraion changes necessary to get your computer ready to develop for the -Carbon.Permissions module. It: +Carbon.Security module. It: .EXAMPLE diff --git a/whiskey.yml b/whiskey.yml index b99030d..638bd6b 100644 --- a/whiskey.yml +++ b/whiskey.yml @@ -6,11 +6,11 @@ Build: - PowerShell: ExceptDuring: Clean - WorkingDirectory: Carbon.Permissions + WorkingDirectory: Carbon.Security ScriptBlock: prism install | Format-Table -Auto - Version: - Path: Carbon.Permissions\Carbon.Permissions.psd1 + Path: Carbon.Security\Carbon.Security.psd1 Prerelease: - main: "" - "*": rc$(WHISKEY_BUILD_NUMBER) @@ -27,10 +27,10 @@ Build: - MergeFile: OnlyBy: BuildServer # Builds run twice on some serves. Only run this step if the module hasn't been merged yet. - IfExists: Carbon.Permissions\Functions\*.ps1 + IfExists: Carbon.Security\Functions\*.ps1 Path: - - Carbon.Permissions\Functions\*.ps1 - DestinationPath: Carbon.Permissions\Carbon.Permissions.psm1 + - Carbon.Security\Functions\*.ps1 + DestinationPath: Carbon.Security\Carbon.Security.psm1 DeleteSourceFiles: true TextSeparator: "$(NewLine)$(NewLine)" @@ -48,12 +48,12 @@ Build: - README.md - LICENSE.txt - NOTICE.txt - DestinationDirectory: Carbon.Permissions + DestinationDirectory: Carbon.Security - Zip: - ArchivePath: .output\Carbon.Permissions-$(WHISKEY_SEMVER2).zip + ArchivePath: .output\Carbon.Security-$(WHISKEY_SEMVER2).zip Path: - - Carbon.Permissions + - Carbon.Security Exclude: - "*.pdb" - "*.orig" @@ -61,17 +61,17 @@ Build: - Exec: OnlyBy: BuildServer Path: appveyor - Argument: [ 'PushArtifact', '.output/Carbon.Permissions-$(WHISKEY_SEMVER2).zip', '-DeploymentName', 'GitHub' ] + Argument: [ 'PushArtifact', '.output/Carbon.Security-$(WHISKEY_SEMVER2).zip', '-DeploymentName', 'GitHub' ] - PublishPowerShellModule: - Path: Carbon.Permissions + Path: Carbon.Security - Exec: OnlyBy: BuildServer Path: appveyor Argument: [ 'PushArtifact', - '.output/Carbon.Permissions.$(WHISKEY_SEMVER2_NO_BUILD_METADATA).nupkg', + '.output/Carbon.Security.$(WHISKEY_SEMVER2_NO_BUILD_METADATA).nupkg', '-DeploymentName', 'PowerShellGallery' ] @@ -85,6 +85,6 @@ Build: TestResult: Enabled: true OutputPath: .output\pester.xml - TestSuiteName: Carbon.Permissions + TestSuiteName: Carbon.Security Output: Verbosity: Detailed