Class: Katello::CdnConfiguration
- Inherits:
-
Model
- Object
- Model
- Katello::CdnConfiguration
- Includes:
- Encryptable
- Defined in:
- app/models/katello/cdn_configuration.rb
Constant Summary collapse
- CDN_TYPE =
'redhat_cdn'.freeze
- NETWORK_SYNC =
'network_sync'.freeze
- EXPORT_SYNC =
'export_sync'.freeze
- CUSTOM_CDN_TYPE =
'custom_cdn'.freeze
- TYPES =
[CDN_TYPE, NETWORK_SYNC, EXPORT_SYNC, CUSTOM_CDN_TYPE].freeze
- REDHAT_CDN_HOST_PATTERN =
/\Acdn(-[a-z]+)?\.redhat\.com\z/
Instance Method Summary collapse
- #custom_cdn? ⇒ Boolean
- #custom_cdn_auth_enabled? ⇒ Boolean
- #export_sync? ⇒ Boolean
- #network_sync? ⇒ Boolean
- #redhat_cdn? ⇒ Boolean
- #redhat_cdn_host? ⇒ Boolean
- #ssl_ca ⇒ Object
Instance Method Details
#custom_cdn? ⇒ Boolean
37 38 39 |
# File 'app/models/katello/cdn_configuration.rb', line 37 def custom_cdn? type == CUSTOM_CDN_TYPE end |
#custom_cdn_auth_enabled? ⇒ Boolean
41 42 43 |
# File 'app/models/katello/cdn_configuration.rb', line 41 def custom_cdn_auth_enabled? custom_cdn_auth_enabled end |
#export_sync? ⇒ Boolean
51 52 53 |
# File 'app/models/katello/cdn_configuration.rb', line 51 def export_sync? type == EXPORT_SYNC end |
#network_sync? ⇒ Boolean
55 56 57 |
# File 'app/models/katello/cdn_configuration.rb', line 55 def network_sync? type == NETWORK_SYNC end |
#redhat_cdn? ⇒ Boolean
33 34 35 |
# File 'app/models/katello/cdn_configuration.rb', line 33 def redhat_cdn? type == CDN_TYPE end |
#redhat_cdn_host? ⇒ Boolean
45 46 47 48 49 |
# File 'app/models/katello/cdn_configuration.rb', line 45 def redhat_cdn_host? URI.parse(url).host&.match?(REDHAT_CDN_HOST_PATTERN) rescue URI::InvalidURIError false end |
#ssl_ca ⇒ Object
29 30 31 |
# File 'app/models/katello/cdn_configuration.rb', line 29 def ssl_ca ssl_ca_credential&.content end |