Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update remote app builder pattern #120

Merged
merged 12 commits into from
Jul 22, 2022
Merged

Update remote app builder pattern #120

merged 12 commits into from
Jul 22, 2022

Conversation

twsouthwick
Copy link
Member

@twsouthwick twsouthwick commented Jul 21, 2022

PR Title
Update builder pattern for remote to clearly separate client and server scenarios

PR Description
This change makes a few API changes we've discussed around being clear around remote app options and extension methods. This introduces a new builder API (ISystemWebAdapterRemoteAppBuilder) that allows for a nested configuration pattern similar to the following:

ASP.NET Core:

builder.Services.AddSystemWebAdapters()
  .AddRemoteAppClient(remote => remote
    .Configure(options =>
    {
      options.RemoteAppUrl = ...
      options.ApiKey = ...
    }
    .AddAuthentication(true)
    .AddSession());

ASP.NET Framework:

SystemWebAdapterConfiguration.AddSystemWebAdapters(this)
    .AddRemoteAppServer(remote => remote
        .Configure(options => options.ApiKey = ... )
        .AddAuthentication()
        .AddSession());

This change also separates out the options for Client/Server to be separate classes

Part of #112

@twsouthwick twsouthwick requested a review from mjrousos July 21, 2022 18:23
@twsouthwick twsouthwick mentioned this pull request Jul 21, 2022
12 tasks
@twsouthwick twsouthwick requested a review from Tratcher July 21, 2022 22:34
Copy link
Member

@mjrousos mjrousos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. As I looked at the changes to samples, though, it occurred to me that we might be able to simplify the API a little by having AddRemoteAppServer and AddRemoteAppClient configure different interfaces (ISystemWebAdapterRemoteAppClientBuilder and ISystemWebAdapterRemoteAppServerBuilder). Then the extension methods that work on those builders wouldn't all need the "client" and "server" designations (since they would extend different interfaces) and overall usage would simplify a little.

@twsouthwick twsouthwick requested a review from mjrousos July 22, 2022 17:46
Copy link
Member

@Tratcher Tratcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll cover this in detail in the next API review.

Copy link
Member

@mjrousos mjrousos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. We should update docs to reflect the changes, too. If you want to do that in a separate PR, though, this part looks good.

@twsouthwick
Copy link
Member Author

:) I was in the process of updating the docs so I wouldn't forget

@twsouthwick twsouthwick enabled auto-merge (squash) July 22, 2022 19:41
@twsouthwick twsouthwick merged commit 55643e1 into main Jul 22, 2022
@twsouthwick twsouthwick deleted the rename-client-server branch July 22, 2022 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants