1

MyDataService.svc.cs 内に次のコードがあります (これは DevExpress の例です)。

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 でこの情報を見ることができる人はいないでしょうか。そうでない場合は、誰かが私が直面している概念上のギャップを埋めてください。ありがとう!

4

1 に答える 1