Let $X$ be $\Sigma^g$ which is the Riemann surface of genus $g$, and consider a trivial $G$-bundle over it.
In this $2$-d setting, the space of Yang-Mills central connections is the set of connections $A$ such that $*F(A)$ (the Hodge dual of its curvature) takes a constant value in the center of the Lie algebra $\mathfrak{g}$. If we let $G = U(n)$, and fix that central element in $\mathfrak{g}$ to be $-2\pi i \frac{k}{n}$ ($k$ is some integer) times the identity matrix, the "moduli space of bundles" is defined as the space of such Yang-Mills central connections $\mathcal{A}_{y-m}^{central, n, k}$ modulo the gauge group $\mathcal{G}$.
However, I find many people use a different setting which seems to be able to give the same moduli space. Here we let $Y = (\Sigma^g \backslash D^2, S^1)$, that is, $X$ with an open disc removed, leaving an $S^1$ as its boundary. Then we consider the space of flat connection $\mathcal{A}_0$ for the trivial $G$-bundle over $Y$ with the property that its holonomy around the $S^1$-boundary is $e^{-2\pi i \frac{k}{n}}$ times the identity matrix. After modding out gauge equivalence one will get the same moduli space. As a corollary one can readily see this is related to $U(n)$ representations of a certain central extension of $\pi_1(\Sigma^g)$.
My question is, what is the best (and rigorous) method to see the two methods are describing the same object? Thank Thank you.