private bool IsTransportSecurityRequired(TransportSecurityContext context) { TransportSecurityRequiredFor requiredOn = WikiApplication.FederationConfiguration.RequireTransportSecurityFor; using (CreateRecursionContext()) { TopicProperty property = _namespaceManager.GetTopicProperty( _namespaceManager.DefinitionTopicName.LocalName, RequirementPropertyName); if (property != null) { if (property.HasValue) { TransportSecurityRequiredFor value; if (TryParseValue(property.LastValue, out value)) { requiredOn = value; } } } } if (requiredOn == TransportSecurityRequiredFor.Content) { return true; } return false; }
private void AssertTransportSecurityRequirement(TransportSecurityContext context) { if (IsRecursing) { return; } if (IsTransportSecurityRequired(context)) { if (!WikiApplication.IsTransportSecure) { throw new TransportSecurityRequirementException(); } } }