Skip to content

Commit a942af6

Browse files
authored
Merge pull request #629 from lightninglabs/persist-config
autopilot: feature configuration
2 parents 71a57a5 + ab39a5b commit a942af6

24 files changed

+969
-368
lines changed

app/src/types/generated/lit-autopilot_pb.d.ts

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/types/generated/lit-autopilot_pb.js

Lines changed: 28 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/types/generated/lit-sessions_pb.d.ts

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/types/generated/lit-sessions_pb.js

Lines changed: 30 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/util/tests/sampleData.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,7 @@ export const litListSessions: LIT.ListSessionsResponse.AsObject = {
972972
},
973973
],
974974
],
975+
featureConfigsMap: [['SampleFeature', '{}']],
975976
},
976977
{
977978
id: '',
@@ -1053,6 +1054,7 @@ export const litListSessions: LIT.ListSessionsResponse.AsObject = {
10531054
},
10541055
],
10551056
],
1057+
featureConfigsMap: [['SampleFeature', '{}']],
10561058
},
10571059
],
10581060
};

autopilotserver/client.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,11 @@ func (c *Client) ListFeatures(ctx context.Context) (map[string]*Feature,
357357
perms := unmarshalPermissions(feature.PermissionsList)
358358
rules := unmarshalRules(feature.Rules)
359359
features[i] = &Feature{
360-
Name: feature.Name,
361-
Description: feature.Description,
362-
Permissions: perms,
363-
Rules: rules,
360+
Name: feature.Name,
361+
Description: feature.Description,
362+
Permissions: perms,
363+
Rules: rules,
364+
DefaultConfig: feature.DefaultConfig,
364365
}
365366
}
366367

autopilotserver/interface.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ type Feature struct {
6868
// Rules is a list of all the firewall that must be specified for this
6969
// feature.
7070
Rules map[string]*RuleValues
71+
72+
// DefaultConfig is a JSON-serialized configuration of the feature. It
73+
// represents the default configuration we can use if the user doesn't
74+
// specify any.
75+
DefaultConfig []byte
7176
}
7277

7378
// RuleValues holds the default value along with the sane max and min values

0 commit comments

Comments
 (0)