File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,29 @@ def get_current_tenancy():
6060 "home_region_key" : tenancy .home_region_key ,
6161 }
6262
63+ @mcp .tool
64+ def create_auth_token (user_id : str ):
65+ identity = get_identity_client ()
66+ token = identity .create_auth_token (user_id = user_id ).data
67+ return {
68+ "token" : token .token ,
69+ "description" : token .description ,
70+ "lifecycle_state" : token .lifecycle_state ,
71+ }
72+
73+ @mcp .tool
74+ def get_current_user ():
75+ identity = get_identity_client ()
76+ config = oci .config .from_file (
77+ profile_name = os .getenv ("OCI_CONFIG_PROFILE" , oci .config .DEFAULT_PROFILE )
78+ )
79+ user_id = config ["user" ]
80+ user = identity .get_user (user_id ).data
81+ return {
82+ "id" : user .id ,
83+ "name" : user .name ,
84+ "description" : user .description ,
85+ }
6386
6487if __name__ == "__main__" :
6588 mcp .run ()
You can’t perform that action at this time.
0 commit comments