Ausnahme gefangen: SSL certificate problem: certificate is not yet valid ๐Ÿ“Œ OData Connected Service 0.4.0 Release

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š OData Connected Service 0.4.0 Release


๐Ÿ’ก Newskategorie: Programmierung
๐Ÿ”— Quelle: devblogs.microsoft.com

OData Connected Service 0.4.0 has been released and is now available on the Visual Studio Marketplace.

The new version adds the following features:

  1. Support for Visual Studio 2019 (in addition to Visual Studio 2017)
  2. Option to generate types as internal so that they are not accessible outside the assembly
  3. Bug fixes

In this article, I would like to take you through some key new features and get you up to speed with using the OData Connected Service.

OData Connected Service in Visual Studio 2019

Letโ€™s start by illustrating how you can use the extension in Visual Studio 2019. Open Visual Studio 2019 and create a new C#ย .Netย Core Console project. Letโ€™s call the project โ€œSampleClientโ€, and the solution โ€œOCSTestโ€.ย Once the project is open, click the Extensions menu, thenย Manage Extensions. In the Manage Extensions window, search for โ€œOData Connected Serviceโ€. Select the extension and install it.ย You may need to close Visual Studio to allow the extension to install, then restart it after installationย completes.

Image OCS 0 4 0 Extensions Download

Alternatively, you can just download the VSIX from the marketplace and double click to install.

Once the extension has been installed. Right-click your project in the solution explorer, then in the context menu select Add > Connected Service. This will open the Connected Services window where you can select which services to add to your project. Select OData Connected Service.

Image Add Connected Service MenuImage Connected Services list 8211 Add OCS

Next, a configuration wizard will open where you can configure how code will be generated for your service.

On the first page, weโ€™ll add the metadata URL of the service we want to access. For this example, letโ€™s use the sample Trip Pin Service. Set the service name to โ€œTripPin Serviceโ€ and the Address to ย https://services.odata.org/TripPinRESTierService/$metadata

Then click Finish.

Image Configure OCS Endpoint

After the process completes, the OData docs website will be launched. Go back to Visual Studio and you will see a connected service added to your project and a Reference.cs file that ย contains all the code generated from the OData code generator.

Image Connected Service Added to Project

Letโ€™s proceed to use the generate classes to interact with the service. Replace the code in Program.cs with the following:

using System; 
using System.Threading.Tasks;
using Microsoft.OData.Service.Sample.TrippinInMemory.Models;
static class Program
{
    static string serviceUri = "https://services.odata.org/TripPinRESTierService/";
    static Container context = new Container(new Uri(serviceUri));
    static void Main()
    {
        ShowPeople().Wait();
    }

    static async Task ShowPeople()
    {
        var people = await context.People.ExecuteAsync();
        foreach (var person in people)
        {
            Console.WriteLine(person.FirstName);
        }
    }
}

The above program fetches people data from the Trip Pin service and then displays their names. If you run the program, it should display a list of names.

Image OData Connected Service app sample people output

To learn more about using the generated client to interact with an OData service, visit this guide.

Generating types as internal

This feature allows you to mark generated types as internal instead of public, so that they are not accessible outside your assembly.

To illustrate this, letโ€™s add a library project to our OCSTest solution. Right-click the solution and click Add > New Project. Create a C# .Net Standard Class Library project and call it SampleLib. This library will expose a simple method that makes use of the same Trip Pin service we used earlier.

Letโ€™s use the same steps as in the previous section to add an OData Connected Service to this project using the same Trip Pin service metadata endpoint.

Next, letโ€™s add a public class to our library project that will contain the method we want to expose to consumers of the library. Letโ€™s name the file LibService.cs. Letโ€™s add the following code in LibService.cs file:

using System;
using System.Threading.Tasks;
using Microsoft.OData.Service.Sample.TrippinInMemory.Models;

namespace SampleLib
{
    public static class LibService
    {
        private static string serviceUri = "https://services.odata.org/TripPinRESTierService/";
        private static Container context = new Container(new Uri(serviceUri));

        public static async Task<string> GetMostPopularPerson()
        {
            var person = await context.GetPersonWithMostFriends().GetValueAsync();
            return $"{person.FirstName} {person.LastName}";
        }
    }
}

The GetMostPopularPerson() method simply fetches the person with the most friends from the service and returns that personโ€™s full name.

Letโ€™s add a reference to SampleLib in our initial console applicaton so that we can use it. Right click the SampleClient project > Add > Reference > Projects > Solution > SampleLib then press OK.

Image Add SampleLib reference

At this point, we can call the method from our SampleLib library in the Main method of the SampleClient console app, by adding the following line at the end of the Main method. The Main method should now look like:

static void Main()
{
    ShowPeople().Wait();
    Console.WriteLine("Most popular: {0}", SampleLib.LibService.GetMostPopularPerson().Result);
}

If you try to run this application, you will get compiler warnings on the Container class, because both the console app and library define classes with the same names in the same namespace. The console app has access to all the proxy classes of the library because they are public. But this is not what we want, we only want to expose the LibService.GetMostPopularPerson() method from the service, the proxy classes should not be accessible outside the library.

To correct this issue, go to the SampleLib project in the solution explorer, under the Connected Services node, you will see a folder for the connected service you added, which is TripPin Serviceย in our example. Right click the folder and select Update Connected Service.

Image Update OCS Menu

This will open up the OData Connected Wizard and allow you to update the configuration. On the Endpoint page click Next to navigate to the Settings page, then click the AdvancedSettings link to reveal more options. Check the Mark generated types as internal checkbox and click Finish.

Image Make types internal OCS option

When asked whether to replace the existing Reference.cs file, click Yes. After the code generation is complete, you can open the generated Reference.cs file and confirm that all top-level classes and enums have an internalย access modifier.

Image Generated code with internal modifier

Finally, build and run the SampleClient project, you will not see the warnings again. The program will display the name of the person with most friends at the end.

Image OData Connected Service app sample output with most popular person

Minor updates and bug fixes

The ByKey method now accepts an IDictionary as a parameter as opposed to the concrete Dictionary class that it allowed before. This allows you to pass your own implementation of IDictionary instead of the standard Dictionary when you need to.

In addition, references to EdmxReader have been replaced with Microsoft.OData.Edm.Csdl.CsdlReader. This fixes some of the compilation errors that occurred in the generated code in the previous version.

ย 

There are more features and fixes coming to OData Connected Service soon, so stay tuned for upcoming releases.

The post OData Connected Service 0.4.0 Release appeared first on OData.

...



๐Ÿ“Œ Using SkipToken for Paging in Asp.Net OData and Asp.Net Core OData


๐Ÿ“ˆ 43.94 Punkte

๐Ÿ“Œ Migrating OData V3 Services to OData V4 without Disrupting Existing Clients


๐Ÿ“ˆ 43.94 Punkte

๐Ÿ“Œ OData Connected Service 0.4.0 Release


๐Ÿ“ˆ 40.55 Punkte

๐Ÿ“Œ OData Connected Service version 0.6.0 Release


๐Ÿ“ˆ 40.55 Punkte

๐Ÿ“Œ OData Connected Service version 0.5.0 Release


๐Ÿ“ˆ 40.55 Punkte

๐Ÿ“Œ OData Connected Service 0.7.1 Release


๐Ÿ“ˆ 40.55 Punkte

๐Ÿ“Œ OData Connected Service v0.8.0 Release


๐Ÿ“ˆ 40.55 Punkte

๐Ÿ“Œ OData Connected Service 0.9.0 Release


๐Ÿ“ˆ 40.55 Punkte

๐Ÿ“Œ OData Connected Service 0.9.1 Release


๐Ÿ“ˆ 40.55 Punkte

๐Ÿ“Œ Vuln: Microsoft OData CVE-2018-8269 Denial of Service Vulnerability


๐Ÿ“ˆ 24.73 Punkte

๐Ÿ“Œ Microsoft Data.OData Web Request denial of service [CVE-2018-8269]


๐Ÿ“ˆ 24.73 Punkte

๐Ÿ“Œ SAP Adaptive Server Enterprise 16 Odata Server Crash denial of service


๐Ÿ“ˆ 24.73 Punkte

๐Ÿ“Œ SAP Focused RUN 200/300 oData Service improper authorization


๐Ÿ“ˆ 24.73 Punkte

๐Ÿ“Œ CVE-2023-29111 | SAP AIF 755/756 ODATA Service information disclosure


๐Ÿ“ˆ 24.73 Punkte

๐Ÿ“Œ SAP Adaptive Server Enterprise 16 Odata Server Crash Denial of Service


๐Ÿ“ˆ 24.73 Punkte

๐Ÿ“Œ SAP Adaptive Server Enterprise 16 Odata Server Crash Denial of Service


๐Ÿ“ˆ 24.73 Punkte

๐Ÿ“Œ Blazor and Customizing the OData entity model | On .NET


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ #0daytoday #Apache Olingo OData 4.0 - XML External Entity Injection Exploit [webapps #exploits #0day #Exploit]


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ [webapps] Apache Olingo OData 4.0 - XML External Entity Injection


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ Apache Olingo OData 4.6.x XML Injection


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ Experimenting with OData in ASP.NET Core 3.1


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ $select Enhancement in ASP.NET Core OData


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ Integrating Cosmos DB with OData (Part 3)


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ Simplifying EDM with OData


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ Enabling Pagination in Blazor with OData


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ Integrating Cosmos DB with OData (Part 1)


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ Enabling Endpoint Routing in OData


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ SAP Mobile Platform 3.0 Offline OData Application information disclosure


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ OData Model Builder now Available


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ Exploring Graph Native Support for OData


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ SAP Gateway 750/751/752/753 OData Request HTTP Header information disclosure


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ Adding a little Swagger to OData | On .NET


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ Customize Control Information for full metadata requests in odata.net


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ Optimizing Web Applications with OData $Select


๐Ÿ“ˆ 21.97 Punkte

๐Ÿ“Œ Aggregation extensions in OData ASP.NET Core


๐Ÿ“ˆ 21.97 Punkte











matomo