1
我里面MyDataService.svc.cs下面的代码(这是从DevExpress的一个例子):WCF服务EntitySetRights.AllRead安全吗?
namespace MyDataService {
[System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
[JSONPSupportBehavior]
public class DataService : DataService<TestDataEntities>, IServiceProvider {
public static void InitializeService(DataServiceConfiguration config) {
config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
}
public object GetService(Type serviceType) {
if (serviceType == typeof(IDataServiceStreamProvider)) {
return new ImageStreamProvider();
}
return null;
}
protected override void OnStartProcessingRequest(ProcessRequestArgs args) {
CustomBasicAuth.Authenticate(HttpContext.Current);
if (HttpContext.Current.User == null)
throw new DataServiceException(401, "Invalid login or password");
base.OnStartProcessingRequest(args);
}
}
}
因此,尽管这是将检查实体用户名和密码,如何安全是它那config.SetEntitySetAccessRule
是设置为AllRead
。是否有人能够在诸如www.website.com/MyDataService.svc/Customer(其中Customer是表格)的url上看到这些信息。如果不是这样,那么请填写我面临的概念差距。谢谢!