Repository: getkin/kin-openapi (go)

Issue:
Support for http authentication other than Basic
The library currently only supports Basic http authentication.  Other mechanisms are in common use - especially Negotiate in enterprise settings, and browsers also support Digest auth.

IANA have a registry : https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml

.. I don't know if all of these should be added to the library or just those supported directly by browsers.

Pull request description:
Support for alternate http auth mechanisms
Fixes #290

Support for negotiate and digest auth schemes that are in common use.

Patch:
diff --git a/openapi3/security_scheme.go b/openapi3/security_scheme.go
index 7e83019..8d6c7c1 100644
--- a/openapi3/security_scheme.go
+++ b/openapi3/security_scheme.go
@@ -115,7 +115,7 @@ func (ss *SecurityScheme) Validate(c context.Context) error {
 		switch scheme {
 		case "bearer":
 			hasBearerFormat = true
-		case "basic":
+		case "basic", "negotiate", "digest":
 		default:
 			return fmt.Errorf("Security scheme of type 'http' has invalid 'scheme' value '%s'", scheme)
 		}


Test patch:
diff --git a/openapi3/security_scheme_test.go b/openapi3/security_scheme_test.go
index 9edb17a..cba0b84 100644
--- a/openapi3/security_scheme_test.go
+++ b/openapi3/security_scheme_test.go
@@ -46,6 +46,26 @@ var securitySchemeExamples = []securitySchemeExample{
 `),
 		valid: true,
 	},
+	{
+		title: "Negotiate Authentication Sample",
+		raw: []byte(`
+{
+  "type": "http",
+  "scheme": "negotiate"
+}
+`),
+		valid: true,
+	},
+	{
+		title: "Unknown http Authentication Sample",
+		raw: []byte(`
+{
+  "type": "http",
+  "scheme": "notvalid"
+}
+`),
+		valid: false,
+	},
 	{
 		title: "API Key Sample",
 		raw: []byte(`