著者:しょっさん
急に寒くなりましたね。雨も降り続いていて、寒い寒いと思っていたら、台風まで来ました。まったく外へ出られるような天候ではありません。こうなったら仕方ありません。家に引きこもってプログラミングはいかがですか。それでは、今月もがんばっていきましょう。
記事本文掲載のシェルスクリプトマガジンvol.51は以下リンク先でご購入できます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
@startuml actor Reins_Agent as user boundary Clients as clients control AuthService as auth entity HostRegistry as host autonumber "[00]" user -> clients : run_auth(Keycode) clients -> auth : authenticate_key(Keycode, IP address) auth -> auth : secret_key? note right : Keycode は正しいか? alt Keycode is varid auth -> host : include? note right : すでに登録済みか? host --> auth : true or false alt unregisterd auth -> auth : create_key() auth --> clients : identified_key clients --> user : identified_key else registerd auth --> clients : true clients -> host : read_hostkeys(IP Address) host --> clients : identified_key clients --> user : identified_key end else not varid auth --> clients : fatal clients --> user : "false" end @enduml |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
@startuml actor Reins_Agent as user boundary Reins_Server as server control Clients as clients control AuthService as auth control Dispatcher as dispatch entity HostRegistry as host autonumber == Varidation == user -> server: keycode, command note right: 'auth'コマンド以外 server -> clients: run_command(keycode) clients -> auth: varid?(keycode) note right: 識別キーは正しいか? auth --> clients: true or falth == run command == alt keycode is varid clients -> dispatch: command(command, options) alt add dispatch -> host: create(IP Address, keycode) host -> host: store host --> dispatch: true or false else list dispatch -> host: read_hosts host --> dispatch: keys else delete dispatch -> host: delete(IP Address) host -> host: store host --> dispatch: true or false end dispatch --> clients: results clients --> server: results else not varid clients --> server: "fatal" end server --> user: results @enduml |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
@startuml actor Reins_Agent as user boundary Clients as clients control AuthService as auth entity HostRegistry as host autonumber "[00]" user -> clients: run_auth(Keycode) clients -> auth: authenticate_key(Keycode, IP address) auth -> auth: secret_key? note right: Keycode は正しいか? alt Keycode is varid auth -> host: include? note right: すでに登録済みか? host --> auth: true or false alt registerd auth -> host: read_hostkeys(IP Address) host --> auth: identified_key else unregisterd auth -> auth: create_key() auth -> host: create(IP Address, keycode) host -> host: store host --> auth: identified_key end auth --> clients: identified_key clients --> user: identified_key else not varid auth --> clients: fatal clients --> user: "fatal" end @enduml |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
@startuml actor Reins_Agent as user boundary Reins_Server as server control Clients as clients control Dispatcher as dispatch entity HostRegistry as host autonumber "[00]" user -> server: keycode, command activate server note right: 'auth'コマンド以外 server -> clients: run_command() activate clients clients -> dispatch: command(keycode, command) activate dispatch alt list dispatch -> host: read_hosts(keycode,IP Address) activate host host -> host: varid?() host --> dispatch: keys deactivate host else delete dispatch -> host: delete(keycode,IP Address) activate host host -> host: varid?() host -> host: store host --> dispatch: result deactivate host end dispatch --> clients: results deactivate dispatch destroy dispatch clients --> server: results deactivate clients destroy clients server --> user: results deactivate server @enduml |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
@startuml class Clients { command: String -keycode: String -options: String -addr: String +run_auth() +run_command() } class AuthService { -secret_key: String +create_key() +authenticate_key() } class Dispatch { -addr: String -keycode: String +command() } class HostRegistry { +hosts: Object -filename: String -varid_ip?() -varid?() +create() +read_hostkeys() +read_hosts() +delete() +empty?() } class Hosts { IP Address: String keycode: String created_date: Date updated_date: Date status: String } Clients --> Dispatch Clients --> AuthService AuthService "*" --> "1" HostRegistry Dispatch --> HostRegistry HostRegistry --> Clients HostRegistry "1" --> "*" Hosts @enduml |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
@startuml actor TaskControl as server boundary Reins_Agent as agent control ExecCommands as comm entity HostRegistry as host autonumber "[00]" loop all_clients server -> agent: identified_key == connection check == agent -> comm: check(identified_key) activate comm comm -> comm: varid?(identified_key) comm --> agent: status deactivate comm destroy comm agent --> server: status deactivate agent == logging status == server -> host: rewrite_status(identified_key, status) activate host host -> host: set_status(identified_key, IPaddress, status) host -> host: store() host --> server: true or false deactivate host end @enduml |