Commit c851625
authored
🩹 [Patch]: Update
## Description
This pull request adds support for connecting to a GitHub App
installation using an explicit installation ID, improving flexibility
and usability in authentication scenarios. The main changes involve
updating the `Connect-GitHubApp` function to accept installation IDs
directly and adding corresponding tests to ensure the new functionality
works as expected.
**Enhancements to authentication logic:**
* Updated the `Connect-GitHubApp.ps1` function to accept an `-ID`
parameter, allowing users to connect directly to installations by their
ID. This replaces the previous pipeline-based `Installation` parameter
with a more flexible approach.
* Added logic to process the new `InstallationID` parameter set,
including verbose logging and warnings when an installation ID is not
found.
**Testing improvements:**
* Added a new test case in `Apps.Tests.ps1` to verify that
`Connect-GitHubApp` successfully connects using the `-ID` parameter for
a single installation, checking key properties of the returned context
object.
* Updated test setup to retrieve the installation object for use in the
new test scenario.
**General improvements:**
* Refactored code to ensure installations are only retrieved when
necessary, improving efficiency and clarity.
## Type of change
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [ ] 📖 [Docs]
- [ ] 🪲 [Fix]
- [x] 🩹 [Patch]
- [ ] Connect-GitHubApp to support installation ID parameter (#525)1 parent 586dd4d commit c851625
File tree
2 files changed
+196
-108
lines changed- src/functions/public/Auth
- tests
2 files changed
+196
-108
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| |||
89 | 95 | | |
90 | 96 | | |
91 | 97 | | |
92 | | - | |
93 | | - | |
94 | | - | |
| 98 | + | |
95 | 99 | | |
96 | 100 | | |
| 101 | + | |
| 102 | + | |
97 | 103 | | |
98 | 104 | | |
99 | 105 | | |
100 | | - | |
101 | | - | |
| 106 | + | |
| 107 | + | |
102 | 108 | | |
103 | 109 | | |
104 | 110 | | |
105 | 111 | | |
106 | 112 | | |
107 | | - | |
108 | | - | |
| 113 | + | |
| 114 | + | |
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
114 | | - | |
115 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
116 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
117 | 143 | | |
| 144 | + | |
118 | 145 | | |
119 | 146 | | |
120 | 147 | | |
121 | | - | |
| 148 | + | |
| 149 | + | |
122 | 150 | | |
123 | 151 | | |
124 | 152 | | |
| |||
0 commit comments