@@ -58,6 +58,8 @@ enum Commands {
5858 // Auth - https://github.com/teambtcmap/btcmap-api/blob/master/docs/rpc-api/auth.md
5959 /// Change admin password. Knowledge of an old password is required
6060 ChangePassword ( command:: admin:: ChangePasswordArgs ) ,
61+ /// Create API key. You need to provide your username and password, as well as a key label
62+ CreateApiKey ( command:: admin:: CreateApiKeyArgs ) ,
6163 /// Login with your username and password and get an auth token
6264 Login ( command:: admin:: LoginArgs ) ,
6365 /// Create a new admin user. New admins have no permissions by default, use add-admin-action to allow certain acitons
@@ -118,6 +120,10 @@ fn main() -> Result<()> {
118120 return command:: admin:: login ( args) ;
119121 }
120122
123+ if let Some ( Commands :: CreateApiKey ( args) ) = & cli. command {
124+ return command:: admin:: create_api_key ( args) ;
125+ }
126+
121127 if let Some ( Commands :: State ( args) ) = & cli. command {
122128 return command:: setup:: state ( args) ;
123129 }
@@ -135,6 +141,7 @@ fn main() -> Result<()> {
135141 // Setup
136142 Commands :: SetServer ( _) => Err ( "supposed to be unreachable" . into ( ) ) ,
137143 Commands :: Login ( _) => Err ( "supposed to be unreachable" . into ( ) ) ,
144+ Commands :: CreateApiKey ( _) => Err ( "supposed to be unreachable" . into ( ) ) ,
138145 Commands :: State ( _) => Err ( "supposed to be unreachable" . into ( ) ) ,
139146 Commands :: ChangePassword ( _) => Err ( "supposed to be unreachable" . into ( ) ) ,
140147 // Element
0 commit comments