Activities of "alper"

this is a consultancy topic and not direclty related to ABP code base. if you face a concrete problem in ABP code we would like to help you.

Create the below extension class in your web project. Set the ForwardedHeaderName to whatever HTTP header the real IP address is in.

public static class ApplicationBuilderExtensions
{
    public static IApplicationBuilder UseCustomHttpHeaders(this IApplicationBuilder builder)
    {
        var options = new ForwardedHeadersOptions
        {
            ForwardedForHeaderName = ForwardedHeadersDefaults.XOriginalHostHeaderName,  //"X-Original-Host"
            ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
        };

        options.KnownNetworks.Clear();
        options.KnownProxies.Clear();

        return builder.UseForwardedHeaders(options);
    }
}

Open your web module class.

 public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
    var app = context.GetApplicationBuilder();
    var env = context.GetEnvironment();

    if (env.IsDevelopment())
    {
        app.UseDeveloperExceptionPage();
        app.UseCustomHttpHeaders();
    }
    else
    {
        app.UseErrorPage();
        app.UseCustomHttpHeaders();
        app.UseHsts();

        app.UseAllElasticApm(context.GetConfiguration());
    }

    //...

Create a simple controller to test it.

public class Test : Controller
{
    public string Index()
    {
        return "Client IP Address: " + HttpContext.Connection.RemoteIpAddress.ToString();
    }
}

Open Postman and make a GET request to TestController

PS: If you want to use X-Forwarded-For header, then remove ForwardedForHeaderName = "X-Original-Host" .

References:

  • https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer
  • https://github.com/IdentityServer/IdentityServer4/blob/main/src/IdentityServer4/src/Endpoints/DiscoveryEndpoint.cs#L53
  • https://github.com/IdentityServer/IdentityServer4/blob/main/src/IdentityServer4/src/Extensions/HttpContextExtensions.cs#L108
  • https://github.com/IdentityServer/IdentityServer4/blob/main/src/IdentityServer4/src/Extensions/HttpContextExtensions.cs#L88

My website is behind a proxy server / load balancer and the client ip is passed in a custom HTTP header. To get the Identity Server work, we need to use the custom HTTP header. The client IP is stored in X-Original-Host HTTP header.

Here are some links for 3rd party component integrations. You can also share your article or request a new article.

  • SyncFusion UI for Blazor https://community.abp.io/articles/using-syncfusion-components-with-the-abp-framework-5ccvi8kc

  • Telerik UI for MVC (Kendo) https://community.abp.io/articles/how-to-integrate-the-telerik-ui-for-asp.net-core-kendo-components-with-the-abp-mvc-ui-u2voab2a

  • DevExtreme MVC Components https://community.abp.io/articles/using-devextreme-components-with-the-abp-framework-zb8z7yqv

  • DevExtreme Angular Component https://community.abp.io/articles/using-devextreme-angular-components-with-the-abp-framework-x5nyvj3i

  • Telerik Blazor Components https://community.abp.io/articles/how-to-integrate-the-telerik-blazor-components-to-the-abp-blazor-ui-q8g31abb

  • Angular Material Components https://community.abp.io/articles/using-angular-material-components-with-the-abp-framework-af8ft6t9

  • Elsa Workflow https://community.abp.io/articles/using-elsa-workflow-with-the-abp-framework-773siqi9

The ABP Commercial and ABP Framework integrates 3rd party solutions to make a bridge between other tools. Be aware that there's no support for the 3rd party libraries, tools, solutions and packages. You can ask your questions to the relevant solutions repository.

...

On the angular side, we have a service, a guard and a directive responsible for permission management. All you need to do is to replace the service with your own. Here is how you can do it

First, create a service of your own. Let's call it CustomPermissionService and extend PermissionService from @abp/ng.core as follows:

import { ConfigStateService, PermissionService } from '@abp/ng.core';
import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root',
})
export class CustomPermissionService extends PermissionService {
  constructor(configStateService: ConfigStateService) {
    super(configStateService);
  }

  getGrantedPolicy$(key: string) {
    return super.getGrantedPolicy$(key);
  }
}

And in app.module.ts, provide this service as follows:

@NgModule({
  // ...
  providers: [
    // ...
    {
      provide: PermissionService,
      useExisting: CustomPermissionService,
    },
  ],
  // ...
})
export class AppModule {}

That's it. Now, when a directive/guard asks for PermissionService from angular, it will inject your service.

For more information about the PermissionService, you can examine it here. https://github.com/abpframework/abp/blob/dev/npm/ng-packs/packages/core/src/lib/services/permission.service.ts

We looking forward the sample code on Angular UI to override the Permissions grant for super User/Admin. We did on API side, looking for angular Sample UI.

wait for 4.4.3 (this week)

Answer

To make a feasible test, you need to add the following features to your new test project to align with the ABP project:

  • Add file system log (serilog middleware)
  • Add audit log (database level)
  • Add input validation
  • Add unit of work feature
  • Add database transaction
  • Add action filters for multi-tenancy , soft delete
  • Add global exception handler
  • Add authentication (Jwt) middleware
  • Add dynamic claim middleware
  • Add CorrelationId for cascading requests
  • Add security HTTP headers

note that I created the list off the top of my head and there'll be other middlewares that process on an HTTP request. once you add these middleware it'll probably be the same.

Here are my answers:

Per example I couldn't search for a string like "Unknown client or client not enabled" or "Bad Request" ... All found results are only single word..

Elastic Search is being used as the search engine. We can configure it to find exact matches as well.


Your forum is also slow.. if i try to open the open issues for 4.4.2 it take a really lot time to display it.

Other question URLs are not slow. Some issues have very long conversation like this one and it gets some time to load. We can improve this by adding Infinite Scrolling or Pagination.


If you Post a message , there should be a preview button

There's a preview button on top of the box.


Also code highlighting would be great and better to read.

This feature is already included in the next milestone.


We are here developers.. so it should be able to open a post and attach some code samples. but its not possible to attach any files. you could also allow uploading up to 30mb code samples .. so it would be easier to exchange with you.

If you would like to share a code sample you can share it via GitHub link. 30 MB code sample is a big file when you think it only contains text.


You should at least provide a Link like the other above in the forum Howto search here....

Search is simple, it only searches the keywords in the question text and title. We'll improve it.


It would be great if you could find a better way for use... like Github or whateveer forum..

Didn't understand this statement.


I find it not suitable that there is no FeedBack Portal for the commcercial Part of ABP like here for Example : https://www.syncfusion.com/feedback

This forum is for bug reports, feedback and suggestion. We refund your question credit, if you report a bug or suggestion. You can also check out https://support.abp.io/QA/Questions/954/We-are-listening-to-you


I would like to post in such a forum especially Feature Requests for all your modules, for abp suite for example. You could see which feature Request gains the mosts Interest and we could follow better that requests. I did try posting such requests in the past in github, but it seems not to work good for me..

Yes this is possible. I'll create a feature request for this.


I wrote this here and opened a ticket because coudn't find better informations from you.. This is not customer oriented. I hope you are interested in our input as customer how to get things better here for us.

Thank you! Your question credit has been refunded.

Suite works with 4.4.X without any issues (even with unified DbContexts explained here). The issue you face is; You added your project before this migration and migrated your project manually. But Suite still doesn't know the correct DbContext file path. To correct this open Suite and remove the solution (this will not delete any of your entities and metada of your entities) And then add the same solution again. This time Suite will find the correct DbContext file.


Alternatively, you can open the Suite database from %UserProfile%\.abp\suite\appsettings.json and fix the following nodes:

  • DbContextModelCreatingExtensionsFilePath
  • MigrationsMigrationsDbContext
Showing 611 to 620 of 1975 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11