Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
heyglen committed Mar 16, 2018
1 parent 50846f0 commit 67325a1
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
# Steps to reproduce the problem:

# New Feature Description:

# Example Syntax

# Link to command reference
77 changes: 77 additions & 0 deletions cisco-ios.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@ variables:
(?:ah-md5-hmac)|
(?:ah-sha-hmac)
)
authentication_methods: |
(?xi)
(?:
(?:auth-guest)|
(?:enable)|
(?:guest)|
(?:if-authenticated)|
(?:if-needed)|
(?:krb5)|
(?:krb-instance)|
(?:krb-telnet)|
(?:line)|
(?:local)|
(?:none)|
(?:radius)|
(?:rcmd)|
(?:tacacsplus)|
(?:tacacs)
)
esp_encryption_transform: |
(?xi)
(?:
Expand Down Expand Up @@ -507,6 +526,7 @@ contexts:
- include: aaa_new_model
- include: system_version
- include: enable_password
- include: aaa_authentication
- include: ipv6_unicast_routing
- include: ipv6_general_prefix
- include: extended_acl
Expand Down Expand Up @@ -883,6 +903,63 @@ contexts:
16: support.constant # Destination Established
17: ios.acl.ace.target_ip # IP target scope
aaa_authentication:
- match: |
(?xi)
^\s*
(?:(aaa\s+authentication)\s+)
(?:
(?:
(login)\s+
(?:
(?:(default)|(\S+))
)
)
)
scope: text.network.cisco.aaa.authentication
captures:
1: support.constant # aaa authentication
2: support.constant # login
3: support.constant # default
4: string.unquoted # group name
push:
- match: |
(?xi)
(?:
(?:
\s+
(
(?:cache)|
(?:group)
)
\s+(\S+)
)?
(
(
\s+
(?:
(?:{{authentication_methods}})|
(?:enable)|
(?:group\s+ldap)|
(?:group\s+radius)|
(?:group\s+tacacs\+)|
(?:krb5-telnet)|
(?:krb5)|
(?:line)|
(?:local-case)|
(?:local)|
(?:none)|
(?:passwd-expiry)
)
)+
)
)
pop: true
captures:
1: support.constant # method group type
2: string.unquoted # method group name
3: entity.other.attribute-name # method
aaa_group:
- match: |
(?xi)
Expand Down
1 change: 1 addition & 0 deletions messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
"2.10.0": "messages/2.10.0.md",
"2.10.1": "messages/2.10.1.md",
"2.11.0": "messages/2.11.0.md",
"2.12.0": "messages/2.12.0.md",
}
13 changes: 13 additions & 0 deletions messages/2.12.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# [2.12.0] - 2018-03-16

## Added

- Cisco IOS

- Highlighting

- [aaa authentication login](https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/security/a1/sec-a1-cr-book/sec-cr-a1.html#wp4227342077)

## Fixed

- [Issue #11](https://github.com/heyglen/network_tech/issues/11): Plugin blocks popups from other plugins
6 changes: 5 additions & 1 deletion network_tech.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
logger = logging.getLogger('net_tech')
logger.handlers = []

SCOPE_PREFIX = 'text.network'

settings = sublime.load_settings('network_tech.sublime-settings')

Expand Down Expand Up @@ -221,8 +222,9 @@ def run(self, edit):


class NetworkAutoCompleteListener(sublime_plugin.ViewEventListener):
# def on_query_completions(self, prefix, locations):
def on_hover(self, point, hover_zone):
if not self.view.scope_name(point).startswith(SCOPE_PREFIX):
return
if hover_zone == sublime.HOVER_TEXT:
if self.view.is_popup_visible():
self.view.hide_popup()
Expand All @@ -234,6 +236,8 @@ def on_modified_async(self):
self.network_info()

def network_info(self, point=None, location=None):
if not self.view.scope_name(point).startswith(SCOPE_PREFIX):
return
regions = self.view.sel() if point is None else [sublime.Region(point, point)]
location = regions[0].end() if location is None else location

Expand Down
21 changes: 20 additions & 1 deletion tests/syntax_test_cisco_ios.cisco-ios
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,26 @@ aaa new-model
aaa group server radius rad_eap
server 10.0.1.1 auth-port 1812 acct-port 1813
!
aaa authentication login eap_methods group rad_eap
aaa authentication login default local
aaa authentication login default auth-guest
aaa authentication login default enable
aaa authentication login default guest
aaa authentication login default if-authenticated
aaa authentication login default if-needed
aaa authentication login default krb5
aaa authentication login default krb-instance
aaa authentication login default krb-telnet
aaa authentication login default line
aaa authentication login default local
aaa authentication login default none
aaa authentication login default radius
aaa authentication login default rcmd
aaa authentication login default tacacs
aaa authentication login default tacacsplus

aaa authentication login LIST_NAME group GROUP_NAME enable none
aaa authentication login default group GROUP_NAME enable none

aaa session-id common
ip subnet-zero
ip cef
Expand Down

0 comments on commit 67325a1

Please sign in to comment.