Ends in:
2 DAYS
5 HRS
53 MIN
34 SEC
Ends in:
2 D
5 H
53 M
34 S
Open Closed

What is the use of API Configuration and Defination #3580


User avatar
0
viswajwalith created
  • ABP Framework version: v5.1.3
  • UI type: MVC
  • DB provider: EF Core / MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

When we are running our MVC application of our Micro Service based solution, we have been observed that api/abp/api-defination and api/abp/api-configuration being called, any specific usage for this? if possible we don't want to have that called if no use.

Please advise.


11 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    It works for the framework. You don;t need to call it.

  • User Avatar
    0
    viswajwalith created

    hi

    It works for the framework. You don;t need to call it.

    But when the application is starting up, it it being called internally can you guide us in preventing the calling of those (MVC UI)

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    This is an endpoint that the framework has to call, you can't prevent it.

  • User Avatar
    0
    viswajwalith created

    hi

    This is an endpoint that the framework has to call, you can't prevent it.

    That's fine, at least can you point the code/file where we had to inject some additional logic before the call of any API call happening from the application.

    We have tried HttpContextIdentityModelRemoteServiceHttpClientAuthenticator but not all API calls are coming under this unless we included the webgateway. Please advise if we missed anything.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi @viswajwalith ,

    That's fine, at least can you point the code/file where we had to inject some additional logic before the call of any API call happening from the application.

    https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs#L85-L122


    You can add some additional properties to this endpoint without overriding the AbpApplicationConfigurationAppService, you can read this article to see how to extend this endpoint and get a general knowledge about this endpoint.

  • User Avatar
    0
    viswajwalith created

    Hi @viswajwalith ,

    That's fine, at least can you point the code/file where we had to inject some additional logic before the call of any API call happening from the application.

    https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs#L85-L122


    You can add some additional properties to this endpoint without overriding the AbpApplicationConfigurationAppService, you can read this article to see how to extend this endpoint and get a general knowledge about this endpoint.

    Thanks for the response, but it looks like this will work in 6.0 only as of now ours is 5.1.3 , do u have any alternate for this or do we need to upgrade to 6.0?

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Thanks for the response, but it looks like this will work in 6.0 only as of now ours is 5.1.3 , do u have any alternate for this or do we need to upgrade to 6.0?

    If you do not want to upgrade your project, you can override the GetAsync method of AbpApplicationConfigurationAppService in your project and update it to your needs.

  • User Avatar
    0
    viswajwalith created

    Thanks for the response, but it looks like this will work in 6.0 only as of now ours is 5.1.3 , do u have any alternate for this or do we need to upgrade to 6.0?

    If you do not want to upgrade your project, you can override the GetAsync method of AbpApplicationConfigurationAppService in your project and update it to your needs.

    as per understanding GetAsync method of AbpApplicationConfigurationAppService will be useful for adding or modifying the Application Configuration Endpoint right? do u think this this Method will be called for all service calls from the application?

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    as per understanding GetAsync method of AbpApplicationConfigurationAppService will be useful for adding or modifying the Application Configuration Endpoint right? do u think this this Method will be called for all service calls from the application?

    Yes, you should override the GetAsync method to modify the Application Configuration Endpoint (if your version is lower than v6.0). This endpoint calls by some framework services. (provides localization key-values, permissions etc.)

  • User Avatar
    0
    viswajwalith created

    as per understanding GetAsync method of AbpApplicationConfigurationAppService will be useful for adding or modifying the Application Configuration Endpoint right? do u think this this Method will be called for all service calls from the application?

    Yes, you should override the GetAsync method to modify the Application Configuration Endpoint (if your version is lower than v6.0). This endpoint calls by some framework services. (provides localization key-values, permissions etc.)

    Thanks for the response @engincan, but I think there is some miss understanding. we are looking to add additional info (custom headers and adding additional query parameter for the request URI) for all of the API calls. but AbpApplicationConfigurationAppService only talks about configuration API right....?

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Thanks for the response @engincan, but I think there is some miss understanding. we are looking to add additional info (custom headers and adding additional query parameter for the request URI) for all of the API calls. but AbpApplicationConfigurationAppService only talks about configuration API right....?

    Yes, you're right it's used to provide configurations.

    So, if you want to add additional info for all of your API calls, you can create a custom middleware and add custom headers or query parameters to request URI.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 02, 2024, 12:35