Yes, the Bible considers slavery moral and legal as long as it is not from your own tribe. Foreign slaves is OK.
Paraphrased from Abraham Lincoln concerning slavery: The only moral exchange or purchase is when both parties agree and benefit.
One making a contract, putting them as an indentured slave, with regard for them working and paying off their car loan was made by persons expecting the contract to benefit both parties. Sometimes it works out, and sometimes it doesn't. Obama being brought to the racist U.S. and suffering the confinement of schools with white students, and having to walk through white racist shopping centers, was with the expectation of him getting a good education, and apparently with him having enough income to purchase a mansion in D.C., Martha's Vinyard, and Hawaii. Obama's father was a Muslim, which would surely make him related to part of the slave trader families of East Africa. If a Jew got into debt, they could lose their property for up to 50 years, or until a Jubilee, and lose their freedom of being a man of property. Their relief was that a Jew couldn't charge interest on a debt from another Jew. But apparently, according to the Scripture, they were not above taking a widow's property Exodus 22:22. Kind of like when the Muslims only collected taxes from kufar/kefir, not fellow Muslims. After the "day of the LORD", the "strangers"/Gentiles will summit to slavery, simply because it will be in their best interest/"benefit". (Isaiah 14:1-2).
Malachi 3:5
“Then I will draw near to you for judgment; and I will be a swift witness against the sorcerers and against the adulterers and against those who swear falsely, and against those who oppress the wage earner in his wages, the widow and the orphan, and those who turn aside the alien and do not fear Me,” says the Lord of hosts.