If you cook and eat it after a decade, for instance, it may lose a bit of flavour, but unopened dried pasta is edible indefinitely.
Canned or dried beans
They’ll be ready to cook even if they’ve been stashed in the corners of your pantry for years. Dried beans may need a bit more soaking after long periods of time.
The high acidity acts as a natural preservative that thwarts germ growth, so it can also last indefinitely. In some varieties other than white distilled, colour alterations or cloudiness may develop after time, but this doesn’t affect taste or quality.