module Crit::Helpers::CGI

Overview

CGI helper module for git-http-backend integration

This module provides functionality to handle Git HTTP protocol by interfacing with git-http-backend CGI script.

Defined in:

helpers/cgi_helper.cr

Constant Summary

Log = ::Log.for(self)

Set up a dedicated logger for CGI operations

Class Method Summary

Class Method Detail

def self.extract_username_from_auth_header(env) #

Extracts username from HTTP Authorization header

@param env [HTTP::Server::Context] The HTTP context @return [String, Nil] The extracted username or nil if not found


[View source]
def self.prepare_cgi_env(env, name, path_info) #

Prepares CGI environment variables for git-http-backend

@param env [HTTP::Server::Context] The HTTP context @param name [String] Repository name @param path_info [String] Path info part of the URL @return [Hash(String, String)] CGI environment variables


[View source]
def self.run_git_http_backend(env, cgi_env) #

Runs git-http-backend CGI script

@param env [HTTP::Server::Context] The HTTP context @param cgi_env [Hash(String, String)] CGI environment variables @return [String] Empty string on success, error message on failure


[View source]