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

fix: allow leading underscore in device name #1427

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

gkc
Copy link
Contributor

@gkc gkc commented Oct 7, 2024

- What I did
fix: allow leading underscore in device name to preserve full backwards compatibility re device name validation.

- How I did it

  • modified regex and associated text strings in validation_utils.dart
  • added unit tests to cover the change
  • ran dart format

- How to verify it
Tests pass

- Additional context
Follow-on from #1420

List<String> args = '-a @daemon'.split(' ');
await expectLater(
() => SshnpdParams.fromArgs(args),
await expectLater(() => SshnpdParams.fromArgs(args),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

dart format

@@ -54,5 +54,5 @@ class DefaultSshnpdArgs {
static const String deviceGroupName = '__none__';
static const String sshPublicKeyPermissions = "";
static const Duration policyHeartbeatFrequency = Duration(minutes: 5);
static const String permitOpen ='localhost:22,localhost:3389';
static const String permitOpen = 'localhost:22,localhost:3389';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

dart format

@@ -26,7 +26,7 @@ void main() {
final p = await SshnpdParams.fromArgs(args);
expect(p.deviceAtsign, '@daemon');
expect(p.policyManagerAtsign, '@policy');
expect(p.managerAtsigns, ['@bob','@chuck']);
expect(p.managerAtsigns, ['@bob', '@chuck']);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

dart format

@gkc gkc merged commit dc08ff9 into trunk Oct 7, 2024
9 checks passed
@gkc gkc deleted the device-allow-leading-underscore branch October 7, 2024 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants