{"modulePath":"github.com/opencloudtech/CloudRING","version":"v0.1.0-c02.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpsecurity\n\nPackage httpsecurity provides a provider-neutral, read-only audit of the public HTTP transport and response-header boundary for CloudRING surfaces.\n\n## Constants\n\n```go\nconst (\n\t// CanaryMaxAgeSeconds is the exact HSTS lifetime installed while a hostname\n\t// is still in its reversible canary phase.\n\tCanaryMaxAgeSeconds uint64 = 300\n\t// SteadyMinAgeSeconds is the minimum HSTS lifetime after steady promotion.\n\tSteadyMinAgeSeconds uint64 = 31_536_000\n)\n```\n\n## Variables\n\n```go\nvar ErrInvalidConfiguration = errors.New(\"invalid HTTP security audit configuration\")\n```\nErrInvalidConfiguration is intentionally opaque so an invalid URL or target identifier cannot be reflected into logs.\n\n## Types\n\n```go\ntype Mode string\n```\nMode selects the redirect and HSTS promotion policy.\n\n```go\nconst (\n\tModeCanary Mode = \"canary\"\n\tModeSteady Mode = \"steady\"\n)\n```\n\n```go\ntype Report struct {\n\tSchemaVersion string       `json:\"schema_version\"`\n\tTargetID      string       `json:\"target_id\"`\n\tMode          Mode         `json:\"mode\"`\n\tSurface       Surface      `json:\"surface\"`\n\tPassed        bool         `json:\"passed\"`\n\tRules         []RuleResult `json:\"rules\"`\n}\n```\nReport is safe to persist or print. TargetID is restricted to a small safe identifier alphabet before any network request is made.\n\n```go\nfunc Audit(ctx context.Context, client *http.Client, target Target, mode Mode) (Report, error)\n```\nAudit performs two read-only GET requests: one over HTTP to inspect the redirect response without following it, then one directly over HTTPS to inspect TLS and response headers. The returned report is sanitized by construction.\n\n```go\ntype RuleResult struct {\n\tID     string `json:\"id\"`\n\tPassed bool   `json:\"passed\"`\n}\n```\nRuleResult exposes only a stable rule identifier and its result. It never contains a URL, response value, body, or transport error.\n\n```go\ntype Surface string\n```\nSurface selects the response-header policy for an interactive browser or an API response.\n\n```go\nconst (\n\tSurfaceBrowser Surface = \"browser\"\n\tSurfaceAPI     Surface = \"api\"\n)\n```\n\n```go\ntype Target struct {\n\tID      string\n\tURL     string\n\tSurface Surface\n}\n```\nTarget identifies one HTTPS surface. URL is input only and is deliberately absent from Report.\n\n","path":"github.com/opencloudtech/CloudRING/pkg/httpsecurity","name":"httpsecurity","synopsis":"Package httpsecurity provides a provider-neutral, read-only audit of the public HTTP transport and response-header boundary for CloudRING surfaces.","isRedistributable":true}
