MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / get_ai_token

Function get_ai_token

webapp_modern.py:19241–19256  ·  view source on GitHub ↗

Get OpenAI API token status (without revealing the actual token)

()

Source from the content-addressed store, hash-verified

19239 try:
19240 actual_path = _resolve_legacy_path('/backups', shared_data.backupdir, file_path)
19241 except ValueError:
19242 return jsonify({'error': 'Invalid path'}), 400
19243 elif file_path == '/uploads' or file_path.startswith('/uploads/'):
19244 try:
19245 actual_path = _resolve_legacy_path('/uploads', shared_data.upload_dir, file_path)
19246 except ValueError:
19247 return jsonify({'error': 'Invalid path'}), 400
19248 else:
19249 return jsonify({'error': 'Invalid path'}), 400
19250
19251 if not os.path.isfile(actual_path):
19252 return jsonify({'error': 'File not found'}), 404
19253
19254 actual_path = os.path.realpath(actual_path)
19255
19256 mime_type, _ = mimetypes.guess_type(actual_path)
19257 mime_type = mime_type or 'application/octet-stream'
19258 file_size = os.path.getsize(actual_path)
19259 ext = os.path.splitext(actual_path)[1].lower()

Callers

nothing calls this directly

Calls 3

get_tokenMethod · 0.95
EnvManagerClass · 0.90
errorMethod · 0.80

Tested by

no test coverage detected