mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-30 02:40:11 +08:00
PRF:20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md
@lujun9972
This commit is contained in:
parent
a45b0b76e6
commit
8356cb0f5c
@ -1,20 +1,20 @@
|
|||||||
[#]:collector:(lujun9972)
|
[#]: collector: (lujun9972)
|
||||||
[#]:translator:(lujun9972)
|
[#]: translator: (lujun9972)
|
||||||
[#]:reviewer:( )
|
[#]: reviewer: (wxy)
|
||||||
[#]:publisher:( )
|
[#]: publisher: ( )
|
||||||
[#]:url:( )
|
[#]: url: ( )
|
||||||
[#]:subject:(Use Emacs to create OAuth 2.0 UML sequence diagrams)
|
[#]: subject: (Use Emacs to create OAuth 2.0 UML sequence diagrams)
|
||||||
[#]:via:(https://www.onwebsecurity.com/configuration/use-emacs-to-create-oauth-2-0-uml-sequence-diagrams.html)
|
[#]: via: (https://www.onwebsecurity.com/configuration/use-emacs-to-create-oauth-2-0-uml-sequence-diagrams.html)
|
||||||
[#]:author:(Peter Mosmans https://www.onwebsecurity.com)
|
[#]: author: (Peter Mosmans https://www.onwebsecurity.com)
|
||||||
|
|
||||||
使用 Emacs 创建 OAuth 2.0 的 UML 序列图
|
使用 Emacs 创建 OAuth 2.0 的 UML 序列图
|
||||||
======
|
======
|
||||||
|
|
||||||
![OAuth 2.0 abstract protocol flow][6]
|
![OAuth 2.0 abstract protocol flow][6]
|
||||||
|
|
||||||
看起来 [OAuth 2.0 框架 ][7] 已经越来越广泛地应用于 web (和 移动) 应用。太棒了!
|
看起来 [OAuth 2.0 框架][7] 已经越来越广泛地应用于 web (和 移动) 应用。太棒了!
|
||||||
|
|
||||||
虽然协议本身并不复杂,但有很多的使用场景,流程和实现可供选择。正如生活中的大多数事物一样,魔鬼在于细节之中。
|
虽然协议本身并不复杂,但有很多的使用场景、流程和实现可供选择。正如生活中的大多数事物一样,魔鬼在于细节之中。
|
||||||
|
|
||||||
在审查 OAuth 2.0 实现或编写渗透测试报告时我习惯画出 UML 图。这方便让人理解发生了什么事情,并发现潜在的问题。毕竟,一图抵千言。
|
在审查 OAuth 2.0 实现或编写渗透测试报告时我习惯画出 UML 图。这方便让人理解发生了什么事情,并发现潜在的问题。毕竟,一图抵千言。
|
||||||
|
|
||||||
@ -24,17 +24,15 @@ Emacs 是世界上最万能的编辑器。在这种场景中,我们用它来
|
|||||||
|
|
||||||
下载 [预先编译好了的 PlantUML jar 文件 ][11],[Emacs][12] 还可以选择下载并安装 [Graphviz][13]。
|
下载 [预先编译好了的 PlantUML jar 文件 ][11],[Emacs][12] 还可以选择下载并安装 [Graphviz][13]。
|
||||||
|
|
||||||
安装并启动 Emacs,然后将下面 Lisp 代码(实际上是配置)写入你的启动文件中(` ~/.emacs.d/init.d` ),这段代码将会
|
安装并启动 Emacs,然后将下面 Lisp 代码(实际上是配置)写入你的启动文件中(`~/.emacs.d/init.d`),这段代码将会:
|
||||||
|
|
||||||
* 配置 ` org-mode` (一种用来组织并编辑文本文件的模式) 来使用 PlantUML
|
* 配置 org 模式(一种用来组织并编辑文本文件的模式)来使用 PlantUML
|
||||||
* 将 ` plantuml` 添加到可识别的` org-babel` 语言中 (这让你可以在文本文件中执行源代码)
|
* 将 `plantuml` 添加到可识别的 “org-babel” 语言中(这让你可以在文本文件中执行源代码)
|
||||||
* 将 PlantUML 代码标注为安全的,从而允许执行
|
* 将 PlantUML 代码标注为安全的,从而允许执行
|
||||||
* 自动显示生成的结果图片
|
* 自动显示生成的结果图片
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```elisp
|
```elisp
|
||||||
;; tell org-mode where to find the plantuml JAR file (specify the JAR file)
|
;; tell org-mode where to find the plantuml JAR file (specify the JAR file)
|
||||||
(setq org-plantuml-jar-path (expand-file-name "~/plantuml.jar"))
|
(setq org-plantuml-jar-path (expand-file-name "~/plantuml.jar"))
|
||||||
|
|
||||||
;; use plantuml as org-babel language
|
;; use plantuml as org-babel language
|
||||||
@ -54,13 +52,13 @@ Emacs 是世界上最万能的编辑器。在这种场景中,我们用它来
|
|||||||
|
|
||||||
如果你还没有启动文件,那么将该代码加入到 `~/.emacs.d/init.el` 文件中然后重启 Emacs。
|
如果你还没有启动文件,那么将该代码加入到 `~/.emacs.d/init.el` 文件中然后重启 Emacs。
|
||||||
|
|
||||||
提示:Control-c Control-f 可以让你创建/打开(新)文件。Control-x Control-s 保存文件,而 Control-x Control-c 退出 Emacs。
|
提示:`Control-c Control-f` 可以让你创建/打开(新)文件。`Control-x Control-s` 保存文件,而 `Control-x Control-c` 退出 Emacs。
|
||||||
|
|
||||||
这就结了!
|
这就结了!
|
||||||
|
|
||||||
要测试该配置,可以创建/打开( Control-c Control-f )后缀为 `.org` 的文件,例如 `test.org` . 这回让 Emacs 切换到 "org-mode" 并识别 "org-babel" 语法。
|
要测试该配置,可以创建/打开(`Control-c Control-f`)后缀为 `.org` 的文件,例如 `test.org`。这会让 Emacs 切换到 org 模式并识别 “org-babel” 语法。
|
||||||
|
|
||||||
输入下面代码,然后在代码中输入 Control-c Control-c 来测试是否安装正常:
|
输入下面代码,然后在代码中输入 `Control-c Control-c` 来测试是否安装正常:
|
||||||
|
|
||||||
```
|
```
|
||||||
#+BEGIN_SRC plantuml :file test.png
|
#+BEGIN_SRC plantuml :file test.png
|
||||||
@ -72,9 +70,9 @@ version
|
|||||||
|
|
||||||
一切顺利的话,你会在 Emacs 中看到文本下面显示了一张图片。
|
一切顺利的话,你会在 Emacs 中看到文本下面显示了一张图片。
|
||||||
|
|
||||||
注意
|
> **注意:**
|
||||||
|
|
||||||
要快速插入类似 ` #+BEGIN_SRC` 和 ` #+END_SRC` 这样的代码片段,你可以使用内置的 Easy Templates 系统:输入 <s 然后按下 TAB,它就会自动为你插入模板。
|
> 要快速插入类似 `#+BEGIN_SRC` 和 `#+END_SRC` 这样的代码片段,你可以使用内置的 Easy Templates 系统:输入 `<s` 然后按下 `TAB`,它就会自动为你插入模板。
|
||||||
|
|
||||||
还有更复杂的例子,下面是生成上面图片的 UML 源代码:
|
还有更复杂的例子,下面是生成上面图片的 UML 源代码:
|
||||||
|
|
||||||
@ -130,7 +128,7 @@ via: https://www.onwebsecurity.com/configuration/use-emacs-to-create-oauth-2-0-u
|
|||||||
作者:[Peter Mosmans][a]
|
作者:[Peter Mosmans][a]
|
||||||
选题:[lujun9972][b]
|
选题:[lujun9972][b]
|
||||||
译者:[lujun9972](https://github.com/lujun9972)
|
译者:[lujun9972](https://github.com/lujun9972)
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
校对:[wxy](https://github.com/wxy)
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user