Commit 9493618
authored
Fix: Disable integration credential validation and add nil checks (#579)
## Summary
This PR addresses potential issues with integration credential
validation by:
1. **Disabling active validation** for GitHub PAT, Google, and GitLab
credentials in the status endpoint
2. **Adding nil pointer checks** in git package initialization
## Changes
### Integration Status (integrations_status.go)
- Removed active token validation for GitHub PAT, Google OAuth, and
GitLab tokens
- Status endpoint now assumes stored credentials are valid
- Added clear comments explaining that integrations will fail gracefully
if credentials are invalid
### Git Package Initialization (main.go)
- Added nil checks for GitHub installation, GitHub PAT credentials, and
GitLab credentials
- Prevents potential nil pointer dereferences when these functions
return nil
## Rationale
Active validation of credentials on every status check can cause:
- Unnecessary API calls to external services
- Potential rate limiting issues
- False negatives due to temporary network issues
Since the backend auto-refreshes tokens and integrations fail gracefully
on actual usage, checking for credential existence is sufficient for the
status endpoint.
## Testing
- [ ] Backend builds successfully
- [ ] Integration status endpoints return expected data
- [ ] No nil pointer dereferences occur during git operations1 parent 51f4297 commit 9493618
2 files changed
Lines changed: 24 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
66 | | - | |
67 | | - | |
| 65 | + | |
| 66 | + | |
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
72 | | - | |
| 71 | + | |
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
| |||
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 91 | + | |
| 92 | + | |
98 | 93 | | |
99 | 94 | | |
100 | 95 | | |
101 | 96 | | |
102 | 97 | | |
103 | 98 | | |
104 | | - | |
| 99 | + | |
105 | 100 | | |
106 | 101 | | |
107 | 102 | | |
| |||
131 | 126 | | |
132 | 127 | | |
133 | 128 | | |
134 | | - | |
135 | | - | |
| 129 | + | |
| 130 | + | |
136 | 131 | | |
137 | 132 | | |
138 | 133 | | |
139 | 134 | | |
140 | 135 | | |
141 | | - | |
| 136 | + | |
142 | 137 | | |
143 | 138 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
98 | 102 | | |
99 | 103 | | |
100 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
101 | 109 | | |
102 | 110 | | |
103 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
104 | 116 | | |
105 | 117 | | |
106 | 118 | | |
| |||
0 commit comments