Script Versioning API is a lightweight backend service designed to track and version changes of scripts/files using GitLab repositories.
The system acts as a middleware between systems (e.g., ServiceNow, servers, automation tools) and GitLab, enabling centralized version control without requiring direct Git usage by end users.
-
Automatically creates a GitLab repository per file:
script-{server}-{file} -
Checks if repository exists before creating
Supports multiple authentication strategies:
-
Uses environment variable:
GITLAB_TOKEN
-
Fetches credentials dynamically from internal endpoint:
http://127.0.0.1:6000/api/secret/{credential} -
Designed for integration with secrets managers (e.g. Conjur)
Controller→ handles requestsGitLabService→ GitLab API logicAuthProvider→ authentication abstraction
Client / ServiceNow / Script Source
↓
FileController
↓
GitLabService
↓
IGitLabAuthProvider
↓ ↓
EnvAuth SecretApiAuth
↓
Secrets Gateway
↓
Conjur
↓
GitLab API
{
"fileName": "script.ps1",
"server": "server01",
"hash": "abc123",
"contentBase64": "ZWNobyBoZWxsbw=="
}- Validates input
- Normalizes names
- Generates repository name
- Ensures repository exists in GitLab
{
"GitLab": {
"AuthType": "Env"
}
}{
"GitLab": {
"AuthType": "SecretApi",
"SecretUrlTemplate": "http://127.0.0.1:6000/api/secret/{credential}",
"Credential": "kontogitlab"
}
}- No tokens stored in code
- Token retrieval abstracted via providers
- Ready for integration with secrets managers (e.g. Conjur)
- Supports credential rotation without app restart
- .NET 8 (ASP.NET Core)
- GitLab REST API
- HttpClient (DI-based)
- JSON serialization
The system currently only creates repositories.
Missing features (planned):
- ❌ File commit to repository
- ❌ Change detection (hash comparison)
- ❌ Version history tracking
- ❌ Branching strategy
- ❌ Rollback support
- Repository creation
- Auth abstraction
- Secret integration
- Commit file to GitLab
- Base64 decoding
- Hash-based deduplication
- Commit versioning
- Metadata storage
- Full GitOps flow
- Rollback support
- Integration with ServiceNow workflows
The goal is to build a centralized versioning engine for scripts and configurations, allowing organizations to:
- Track all changes across environments
- Eliminate manual script management
- Integrate versioning into existing ITSM processes
- Improve security and auditability
dotnet runAPI available at:
http://localhost:5215
Internal / Private project (customizable)