consts.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package samlutils
  15. const (
  16. XMLNS_MD = "urn:oasis:names:tc:SAML:2.0:metadata"
  17. XMLNS_DS = "http://www.w3.org/2000/09/xmldsig#"
  18. XMLNS_PROTO = "urn:oasis:names:tc:SAML:2.0:protocol"
  19. XMLNS_ASSERT = "urn:oasis:names:tc:SAML:2.0:assertion"
  20. PROTOCOL_SAML2 = "urn:oasis:names:tc:SAML:2.0:protocol"
  21. KEY_USE_SIGNING = "signing"
  22. KEY_USE_ENCRYPTION = "encryption"
  23. NAME_ID_FORMAT_PERSISTENT = "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
  24. NAME_ID_FORMAT_TRANSIENT = "urn:oasis:names:tc:SAML:2.0:nameid-format:transient"
  25. NAME_ID_FORMAT_EMAIL = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
  26. NAME_ID_FORMAT_UNSPEC = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"
  27. NAME_ID_FORMAT_X509 = "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName"
  28. NAME_ID_FORMAT_WINDOWS = "urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName"
  29. NAME_ID_FORMAT_KERBEROS = "urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos"
  30. NAME_ID_FORMAT_ENTITY = "urn:oasis:names:tc:SAML:2.0:nameid-format:entity"
  31. SAML2_VERSION = "2.0"
  32. STATUS_SUCCESS = "urn:oasis:names:tc:SAML:2.0:status:Success"
  33. BINDING_HTTP_POST = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
  34. BINDING_HTTP_REDIRECT = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
  35. HTML_SAML_FORM_TOKEN = "$FORM$"
  36. DEFAULT_HTML_TEMPLATE = `<!DOCTYPE html><html lang="en-US"><body>$FORM$</body></html>`
  37. )
  38. var (
  39. NAME_ID_FORMATS = []string{
  40. NAME_ID_FORMAT_PERSISTENT,
  41. NAME_ID_FORMAT_TRANSIENT,
  42. NAME_ID_FORMAT_EMAIL,
  43. NAME_ID_FORMAT_UNSPEC,
  44. NAME_ID_FORMAT_X509,
  45. NAME_ID_FORMAT_WINDOWS,
  46. NAME_ID_FORMAT_KERBEROS,
  47. NAME_ID_FORMAT_ENTITY,
  48. }
  49. )