Skip to content

Commit 7a39110

Browse files
CopilotJusterZhu
andcommitted
Add documentation for ServerUrl architecture and update DownloadUrl comments
Co-authored-by: JusterZhu <11714536+JusterZhu@users.noreply.github.com>
1 parent d72233b commit 7a39110

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

src/c#/GeneralUpdate.Extension/Metadata/ExtensionDescriptor.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ public class ExtensionDescriptor
7575

7676
/// <summary>
7777
/// Gets or sets the download URL for the extension package.
78+
/// NOTE: This field is optional and primarily for backward compatibility.
79+
/// The system constructs download URLs dynamically from the ServerUrl configured in ExtensionHostConfig.
80+
/// Format: {ServerUrl}/Download/{ExtensionName}
7881
/// </summary>
7982
[JsonPropertyName("downloadUrl")]
8083
public string? DownloadUrl { get; set; }

src/c#/GeneralUpdate.Extension/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,32 @@ host.UpdateStateChanged += (sender, args) =>
5959
var installed = host.GetInstalledExtensions();
6060
```
6161

62+
## Server URL Architecture
63+
64+
The extension system uses a server-based architecture for querying and downloading extensions. The `ServerUrl` configured in `ExtensionHostConfig` serves as the base URL for all extension operations.
65+
66+
### URL Construction
67+
68+
The system automatically constructs the following endpoints:
69+
70+
- **Query Endpoint**: `{ServerUrl}/Query` - Used for searching and filtering extensions
71+
- **Download Endpoint**: `{ServerUrl}/Download/{ExtensionName}` - Used for downloading extension packages
72+
73+
### Example
74+
75+
If your `ServerUrl` is `https://your-server.com/api/extensions`:
76+
- Query endpoint: `https://your-server.com/api/extensions/Query`
77+
- Download for extension "my-extension": `https://your-server.com/api/extensions/Download/my-extension`
78+
79+
### Server Requirements
80+
81+
Your server should implement these endpoints:
82+
83+
1. **Query Endpoint** - Returns available extensions based on filter criteria
84+
2. **Download Endpoint** - Returns the extension package file (typically .zip format)
85+
86+
The `DownloadUrl` field in extension descriptors is now optional and primarily for backward compatibility. The system constructs download URLs dynamically from the configured ServerUrl.
87+
6288
## Complete Usage Guide
6389

6490
### 1. Dependency Injection Setup

0 commit comments

Comments
 (0)